Example #1
0
        public void SetupGameRefs()
        {
            if (gm == null)
            {
                gm = GameManager.instance;
            }

            if (pd == null && PlayerData.instance != null)
            {
                pd = PlayerData.instance;
            }

            if (GameManager.instance.IsGameplayScene() && UIManager.instance.uiState.ToString() == "PLAYING")
            {
                if (hc == null && HeroController.instance != null)
                {
                    hc = HeroController.instance;
                    if (spriteFlash == null)
                    {
                        spriteFlash = hc.GetComponent <SpriteFlash>();
                        LogDebug("Hero object set. SpriteFlash component gotten.");
                    }
                }
            }

            // Uncomment for void.
            //gm.gameObject.AddComponent<Blackmoth.Berserker>();

            // Uncomment for Redwing.
            Redwing.Knight rk = gm.gameObject.AddComponent <Redwing.Knight>();
            rk.EnableRedwing();
            gm.gameObject.AddComponent <health.newhealthmanager>();
        }