| 1234567891011121314151617181920212223242526272829 |
- using UnityEngine;
- namespace Flux
- {
- //[FEvent("Game Object/Instantiate")]
- public class FInstantiateEvent : FEvent
- {
- [SerializeField]
- private GameObject _prefab = null;
- private GameObject _instance;
- protected override void OnTrigger( float timeSinceTrigger )
- {
- _instance = (GameObject)Instantiate( _prefab );
- }
- protected override void OnStop ()
- {
- if( _instance != null )
- {
- if( Application.isPlaying )
- Destroy( _instance );
- else
- DestroyImmediate( _instance );
- }
- }
- }
- }
|