Example #1
0
        private void DestroyEverything()
        {
            if (spoutSender != System.IntPtr.Zero)
            {
                GraphicEventManager.IssuePluginEvent((int)NativePluginBridge.SPOUT.GraphicEvent.Dispose, spoutSender);
                spoutSender = System.IntPtr.Zero;
            }
            // Unregister delegates properly
            GetTextureByOnRenderImage getTextureComponent = gameObject.GetComponent <GetTextureByOnRenderImage>();

            if (getTextureComponent != null)
            {
                getTextureComponent.UnregisterDelegates();
            }
            // Don't bother to destroy managed components in case of game starting
            if (!EditorApplication.isPlayingOrWillChangePlaymode)
            {
                MonoBehaviourManager.DestroyManagedComponent <GetTextureByOnRenderImage>(gameObject, null);
            }
            Utils.DestroyUnityObject(blitMaterial);
            Utils.DestroyUnityObject(sharedTexture);
        }
Example #2
0
        private void destroyEverything()
        {
            // Make sure to unregister
            GetTextureByAsyncReadback getTextureComponent = gameObject.GetComponent <GetTextureByAsyncReadback>();

            if (getTextureComponent != null)
            {
                getTextureComponent.UnregisterDelegates();
            }

            // Don't bother to destroy managed components in case of game starting
            if (!EditorApplication.isPlayingOrWillChangePlaymode)
            {
                MonoBehaviourManager.DestroyManagedComponent <GetTextureByAsyncReadback>(gameObject, null);
            }

            if (ndiSender != IntPtr.Zero)
            {
                NativePluginBridge.NDI.DestroySender(ndiSender);
                ndiSender = IntPtr.Zero;
            }
        }
Example #3
0
 IEnumerator ShootStartIE()
 {
     while (_wave > 0)
     {
         var bullet = PoolManager.InstantiateGameObject(_bullet, PoolType.Bullet);
         MonoBehaviourManager.Add(bullet.GetComponent <BulletBase>(), _bulletDamage, _targetLayer);
         bullet.transform.position = transform.position;
         bullet.transform.right    = _bulletDir;
         _wave--;
         if (_intervalTime != 0)
         {
             float timeCount = 0;
             while (timeCount < _intervalTime)
             {
                 timeCount += GameManager.DeltaTime;
                 yield return(null);
             }
         }
         //yield return new WaitForSeconds(_intervalTime);
     }
     ShootEnd = true;
 }
Example #4
0
    private void Start()
    {
        string path = "";

        switch (Type)
        {
        case EnemyType.怪物:
            MonsterConfig mCfg = MonsterConfig.GetData(EnemyId);
            path = PathManager.RolePrefabsPath + mCfg.Name + "/" + mCfg.Name;
            break;

        case EnemyType.Boss:
            BossConfig bCfg = BossConfig.GetData(EnemyId);
            path = PathManager.RolePrefabsPath + bCfg.Name + "/" + bCfg.Name;
            break;
        }
        var obj = ResourceManager.Load <GameObject>(path);
        var go  = GameObject.Instantiate(obj);

        go.transform.SetParent(transform, false);
        var character = go.GetComponent <Character>();

        MonoBehaviourManager.Add(character);
    }
Example #5
0
 public static void StopOtherTime(MonoEntity mono, bool value)
 {
     MonoBehaviourManager.SetOtherAnimatorSpeed(mono, value?0:1);
     IsTimeStop = value;
 }
Example #6
0
 void OnDestroy()
 {
     MonoBehaviourManager.WipeCleanManagedComponents(gameObject);
 }
Example #7
0
 void OnDisable()
 {
     MonoBehaviourManager.WipeCleanManagedComponents(gameObject);
 }
Example #8
0
 private void DestroyManagedComponents(System.Action callback)
 {
     MonoBehaviourManager.WipeCleanManagedComponents(gameObject);
     callback.Invoke();
 }
Example #9
0
 void OnDestroy()
 {
     MonoBehaviourManager.Remove(this);
 }
Example #10
0
 void OnEnable()
 {
     MonoBehaviourManager.Add(this);
 }
Example #11
0
 public virtual void OnDestory()
 {
     MonoBehaviourManager.Remove(this);
 }