차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
마지막 판양쪽 다음 판
unity:타이머로_프리팹_제거하기 [2016/06/22 06:57] 115.93.88.196unity:타이머로_프리팹_제거하기 [2018/01/18 18:33] V_L
줄 14: 줄 14:
  }  }
  </file>  </file>
 + 
 +[[prefab]]에 스크립트를 넣으면 된다. 
  
-위의 방법으로 하면 본체가 제거된다. 클론을 제거하려면 아래와 같이 한다 ([[http://answers.unity3d.com/questions/608561/i-need-to-destroy-prefab-clones.html|출처]])+ 
 + 
 +클론을 제거하려면 아래와 같이 한다 ([[http://answers.unity3d.com/questions/608561/i-need-to-destroy-prefab-clones.html|출처]])
  
 <file csharp> <file csharp>
 public class bolt_move : MonoBehaviour { public class bolt_move : MonoBehaviour {
     GameObject item;     GameObject item;
- public float speed;+    public float speed;
     public float lifeTime = 1.0f; //life      public float lifeTime = 1.0f; //life 
- // Use this for initialization +  
- void Start () {+    void Start () {
         Destroy(GameObject.Find(item.name + "(Clone)"),lifeTime);         Destroy(GameObject.Find(item.name + "(Clone)"),lifeTime);
         //prefab timed removal          //prefab timed removal 
-        // +        // http://answers.unity3d.com/questions/608561/i-need-to-destroy-prefab-clones.html 
 +        
     }     }
  

CC Attribution-Noncommercial-Share Alike 4.0 International 별도로 명시하지 않을 경우, 이 페이지의 내용은 다음 라이선스에 따라 사용할 수 있습니다: CC Attribution-Noncommercial-Share Alike 4.0 International
unity/타이머로_프리팹_제거하기.txt · 마지막으로 수정됨 저자 127.0.0.1