コード例 #1
0
    void Awake()
    {
        if (Instance != null)
        {
            Debug.LogError("Multiple SpecialEffects objects created!");
        }

        Instance = this;
    }
コード例 #2
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///                                             PRIVATE FUNCTIONS											     ///
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// <summary>
    /// Called on start of the game object to init variables
    /// </summary>
    void Awake()
    {
        // Register the singleton
        if (Instance != null)
        {
            Debug.LogError("Multiple instances of SoundEffectsManager!");
        }
        Instance = this;

        OnLevelWasLoaded(0);
    }
コード例 #3
0
 private void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #4
0
    public void OnActivate()
    {
        if (isActivate)
        {
            return;
        }

        for (int i = 0; i < 4; i++)
        {
            foreach (var item in GameManager.singleton.SpecialEffects_Pools)
            {
                if (!item.gameObject.activeInHierarchy)
                {
                    SpecialEffectsManager se = item.GetComponent <SpecialEffectsManager>();

                    if (se.SpecialEffectsCode == 4)
                    {
                        if (i == 0)
                        {
                            se.OnEndPlayingSpecialEffects(Platforms_1.position);
                        }
                        else if (i == 1)
                        {
                            se.OnEndPlayingSpecialEffects(Platforms_2.position);
                        }
                        else if (i == 2)
                        {
                            se.OnEndPlayingSpecialEffects(Platforms_3.position);
                        }
                        else if (i == 3)
                        {
                            se.OnEndPlayingSpecialEffects(Platforms_4.position);
                        }

                        break;
                    }
                }
            }
        }

        gameObject.SetActive(true);

        StartCoroutine(StartCasting());
    }
コード例 #5
0
 void Awake()
 {
     instance = this;
 }