Пример #1
0
 public void Despawn(RosemarySpawn spawn)
 {
     if (spawn)
     {
         spawn.gameObject.SetActive(false);
     }
 }
Пример #2
0
 public void OnSpawnDisable(RosemarySpawn spawn)
 {
     if (spawn)
     {
         m_inactive.Add(spawn);
         m_active.Remove(spawn);
     }
     OnSpawnDisableExtra(spawn);
 }
Пример #3
0
 public void OnSpawnDestroy(RosemarySpawn spawn)
 {
     if (spawn)
     {
         m_inactive.Remove(spawn);
         m_active.Remove(spawn);
     }
     OnSpawnDestoryExtra(spawn);
 }
Пример #4
0
 private void PrepareSpawn()
 {
     if (!m_spawn)
     {
         m_spawn = GetComponent <RosemarySpawn>();
         if (!m_spawn)
         {
             Debug.LogError($"{nameof(RosemarySpawn)} component not found on GameObject.", this);
         }
     }
 }
Пример #5
0
        protected override void OnSpawnDisableExtra(RosemarySpawn spawn)
        {
            if (!spawn)
            {
                return;
            }
            var element = spawn.GetComponent <RosemaryResourceAmountPanel>();

            if (!element)
            {
                return;
            }

            m_elements.Remove(element.resourceName);
        }
Пример #6
0
        protected override void OnSpawnDisableExtra(RosemarySpawn spawn)
        {
            if (!spawn)
            {
                return;
            }
            var button = spawn.GetComponent <RosemaryProductButton>();

            if (!button)
            {
                return;
            }

            if (button.product)
            {
                m_buttons.Remove(button.product);
            }
        }
Пример #7
0
 private void PrepareSpawn()
 {
     if (!m_spawn)
     {
         m_spawn = GetComponent <RosemarySpawn>();
         if (!m_spawn)
         {
             Debug.LogError($"{nameof(RosemarySpawn)} component not found on GameObject.", this);
         }
         else
         {
             spawner = spawn.spawner as RosemaryProjectileSpawner;
             if (!spawner)
             {
                 Debug.LogError($"Spawner is not a {nameof(RosemaryProjectileSpawner)}", spawn.spawner);
             }
         }
     }
 }
Пример #8
0
        public void OnSpawnAwake(RosemarySpawn spawn)
        {
            switch (spawnMode)
            {
            case SpawnMode.Reserving:
            {
                m_inactive.Add(spawn);
                spawn.gameObject.SetActive(false);
            }
            break;

            default:
            case SpawnMode.Spawning:
            case SpawnMode.PreExisting:
            {
                m_active.Add(spawn);
            }
            break;
            }
            OnSpawnAwakeExtra(spawn);
        }
Пример #9
0
 protected virtual void OnSpawnDisableExtra(RosemarySpawn spawn)
 {
 }
Пример #10
0
 protected virtual void OnSpawnAwakeExtra(RosemarySpawn spawn)
 {
 }
Пример #11
0
 public void InternalSetPrefab(RosemarySpawn value) => m_prefab = value;
Пример #12
0
 protected virtual void OnSpawnDestoryExtra(RosemarySpawn spawn)
 {
 }