Пример #1
0
 void Start()
 {
     GM           = GameObject.Find("GameManager");
     magicSystem  = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
     meteorButton = GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().UsedButton;
     GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().stopAttack = false;
 }
Пример #2
0
    void Start()
    {
        //MAGIC
        staff     = GameObject.Find("Staff");
        msRef     = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
        waterForm = GameObject.Find("WaterForm");
        waterForm.SetActive(false);
        //MAGIC

        //PLAYER
        jumpSpeed        = 12;
        playerController = gameObject.GetComponent <CharacterController>();
        //PLAYER

        Time.timeScale = 1.0f;

        //HEALTH
        HealthUI = GameObject.Find("HealthUI");
        //HEALTH

        //ANIMATION
        playerAnim = GetComponent <Animator>();
        //ANIMATION

        //AUDIO
        playerSource = GetComponent <AudioSource>();
        //AUDIO
        FreezeBlock.SetActive(false);
    }
Пример #3
0
    private void Start()
    {
        GM          = GameObject.Find("GameManager");
        magicSystem = GameObject.Find("MagicUI").GetComponent <MagicSystem>();

        MSButton = GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().UsedButton;
        if (MSButton == "j")
        {
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().activeAbillity1          = true;
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().ability1Image.fillAmount = 0;
        }
        if (MSButton == "k")
        {
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().activeAbillity2          = true;
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().ability2Image.fillAmount = 0;
        }
        if (MSButton == "l")
        {
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().activeAbillity3          = true;
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().ability3Image.fillAmount = 0;
        }
        if (MSButton == ";")
        {
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().activeAbillity4          = true;
            GameObject.Find("MagicUI").GetComponent <MagicSystem>().ability4Image.fillAmount = 0;
        }
    }
Пример #4
0
 void Start()
 {
     Destroy(GameObject.Find("Gnome Turret(Clone)"));
     TurretRotate = GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().oppositeFireRotation;
     GM           = GameObject.Find("GameManager");
     magicSystem  = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
     meteorButton = GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().UsedButton;
     GameObject.Find("PlayerFunctionality").GetComponent <MagicSpells>().stopAttack = false;
 }
    void Inif()
    {
        m_hpController = GameObject.Find("HitPointBar").transform.Find("HpFill").
                         GetComponent <BarController>();
        m_mpController = GameObject.Find("MagicPointBar").transform.Find("HpFill").
                         GetComponent <BarController>();

        m_lifeSystem  = GetComponent <LifeSystem>();
        m_magicSystem = GetComponent <MagicSystem>();
    }
Пример #6
0
 public Player()
 {
     name          = "Player";
     form          = '@';
     color         = ConsoleColor.Red;
     specification = new PlayerSpecifications();
     inventory     = new PlayerInventory();
     perksSystem   = new PerksSystem();
     magicSystem   = new MagicSystem();
 }
Пример #7
0
 void Awake()
 {
     WaterForm   = GameObject.Find("WaterForm");
     tfRef       = GameObject.Find("PlayerFunctionality");
     magicSystem = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
     magicSource = GameObject.Find("SoundEffectPlayer").GetComponent <AudioSource>();
     hRef        = GameObject.Find("HealthUI").GetComponent <Health>();
     GM          = GameObject.Find("GameManager");
     ssn         = GM.GetComponent <SkillSystemNew>();
 }
Пример #8
0
    void Start()
    {
        gNum          = 0;
        pendantChoice = true;
        if (playerGO == null && GameObject.Find("PlayerFunctionality"))
        {
            playerGO  = GameObject.FindGameObjectWithTag("Player");
            msRef     = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
            knightAOE = GameObject.FindGameObjectWithTag("KnightPE");
            Debug.Log(knightAOE);
        }

        if (GameObject.Find("PendantCanvas") && pCanvas == null)
        {
            pCanvas    = GameObject.Find("PendantCanvas");
            selectText = GameObject.Find("SelectionBG").GetComponentInChildren <Text>();
            pCanvas.SetActive(false);
            pKnight      = GameObject.Find("KnightImage");
            pDragon      = GameObject.Find("DragonImage");
            pBear        = GameObject.Find("BearImage");
            pShamrock    = GameObject.Find("ShamrockImage");
            pCastle      = GameObject.Find("CastleImage");
            pGoddess     = GameObject.Find("GoddessImage");
            pWizard      = GameObject.Find("WizardImage");
            pEagle       = GameObject.Find("EagleImage");
            pKnight2     = GameObject.Find("KnightRight");
            pDragon2     = GameObject.Find("DragonRight");
            pBear2       = GameObject.Find("BearRight");
            pShamrock2   = GameObject.Find("ShamrockRight");
            pCastle2     = GameObject.Find("CastleRight");
            pGoddess2    = GameObject.Find("GoddessRight");
            pWizard2     = GameObject.Find("WizardRight");
            pEagle2      = GameObject.Find("EagleRight");
            playerHealth = GameObject.Find("HealthUI").GetComponent <Health>();
        }

        ////PENDANT
        //knightAOE = GameObject.Find("KnightPE");
        pSide1   = null;
        pSide2   = null;
        pCurSide = pSide1;
        //PENDANT
    }
Пример #9
0
    void Update()
    {
        if (playerGO == null && GameObject.Find("PlayerFunctionality"))
        {
            playerGO  = GameObject.FindGameObjectWithTag("Player");
            msRef     = GameObject.Find("MagicUI").GetComponent <MagicSystem>();
            knightAOE = GameObject.FindGameObjectWithTag("KnightPE");
            Debug.Log(knightAOE);
        }

        if (GameObject.Find("PendantCanvas") && pCanvas == null)
        {
            pCanvas    = GameObject.Find("PendantCanvas");
            selectText = GameObject.Find("SelectionBG").GetComponentInChildren <Text>();
            pCanvas.SetActive(false);
            pKnight      = GameObject.Find("KnightImage");
            pDragon      = GameObject.Find("DragonImage");
            pBear        = GameObject.Find("BearImage");
            pShamrock    = GameObject.Find("ShamrockImage");
            pCastle      = GameObject.Find("CastleImage");
            pGoddess     = GameObject.Find("GoddessImage");
            pWizard      = GameObject.Find("WizardImage");
            pEagle       = GameObject.Find("EagleImage");
            pKnight2     = GameObject.Find("KnightRight");
            pDragon2     = GameObject.Find("DragonRight");
            pBear2       = GameObject.Find("BearRight");
            pShamrock2   = GameObject.Find("ShamrockRight");
            pCastle2     = GameObject.Find("CastleRight");
            pGoddess2    = GameObject.Find("GoddessRight");
            pWizard2     = GameObject.Find("WizardRight");
            pEagle2      = GameObject.Find("EagleRight");
            playerHealth = GameObject.Find("HealthUI").GetComponent <Health>();
        }

        if (pCanvas != null)
        {
            if (!pCanvas.activeInHierarchy)
            {
                pendantChoice = true;
            }

            //PENDANT EFFECTS

            //GODDESS PENDANT
            if (pSide1 == Goddess)
            {
                pGoddess.SetActive(true);
                if (pGoddess2.activeInHierarchy)
                {
                    pGoddess2.SetActive(false);
                }
                if (gNum == 5)
                {
                    gNum = 0;
                    gameObject.GetComponentInChildren <AudioSource>().PlayOneShot(goddessProc);
                    playerHealth.Heal();
                }
            }
            if (pSide2 == Goddess)
            {
                pGoddess2.SetActive(true);
                if (pGoddess.activeInHierarchy)
                {
                    pGoddess.SetActive(false);
                }
            }
            if (pSide1 != Goddess && pSide2 != Goddess)
            {
                pGoddess.SetActive(false);
                pGoddess2.SetActive(false);
            }
            //GODDESS PENDANT

            //CASTLE PENDANT
            if (pSide1 == Castle)
            {
                pCastle.SetActive(true);
                if (pCastle2.activeInHierarchy)
                {
                    pCastle2.SetActive(false);
                }
            }
            if (pSide2 == Castle)
            {
                pCastle2.SetActive(true);
                if (pCastle.activeInHierarchy)
                {
                    pCastle.SetActive(false);
                }
            }
            if (pSide1 != Castle && pSide2 != Castle)
            {
                pCastle.SetActive(false);
                pCastle2.SetActive(false);
            }
            //CASTLE PENDANT

            //EAGLE PENDANT
            if (pSide1 == Eagle)
            {
                pEagle.SetActive(true);
                if (pEagle2.activeInHierarchy)
                {
                    pEagle2.SetActive(false);
                }
            }
            if (pSide2 == Eagle)
            {
                pEagle2.SetActive(true);
                if (pEagle.activeInHierarchy)
                {
                    pEagle.SetActive(false);
                }
            }
            if (pSide1 != Eagle && pSide2 != Eagle)
            {
                pEagle.SetActive(false);
                pEagle2.SetActive(false);
            }
            //EAGLE PENDANT

            //WIZARD PENDANT
            if (pSide1 == Wizard)
            {
                pWizard.SetActive(true);
                if (pWizard2.activeInHierarchy)
                {
                    pWizard2.SetActive(false);
                }
            }
            if (pSide2 == Wizard)
            {
                pWizard2.SetActive(true);
                if (pWizard.activeInHierarchy)
                {
                    pWizard.SetActive(false);
                }
            }
            if (pSide1 != Wizard && pSide2 != Wizard)
            {
                pWizard.SetActive(false);
                pWizard2.SetActive(false);
            }
            //WIZARD PENDANT

            //BEAR PENDANT
            if (pSide1 == Bear)
            {
                pBear.SetActive(true);
                if (pBear2.activeInHierarchy)
                {
                    pBear2.SetActive(false);
                }
            }
            if (pSide2 == Bear)
            {
                pBear2.SetActive(true);
                if (pBear.activeInHierarchy)
                {
                    pBear.SetActive(false);
                }
            }
            if (pSide1 != Bear && pSide2 != Bear)
            {
                pBear.SetActive(false);
                pBear2.SetActive(false);
            }
            //BEAR PENDANT

            // TURTLE PENDANT
            if (pSide1 == Dragon)
            {
                //msRef.MaxMana = 150;
                pDragon.SetActive(true);
                if (pDragon2.activeInHierarchy)
                {
                    pDragon2.SetActive(false);
                }
            }
            if (pSide2 == Dragon)
            {
                //msRef.MaxMana = 150;
                pDragon2.SetActive(true);
                if (pDragon.activeInHierarchy)
                {
                    pDragon.SetActive(false);
                }
            }
            if (pSide1 != Dragon && pSide2 != Dragon)
            {
                //msRef.MaxMana = 100;
                pDragon.SetActive(false);
                pDragon2.SetActive(false);
            }
            // TURTLE PENDANT

            // KNIGHT PENDANT
            if (pSide1 == Knight)
            {
                knightAOE.SetActive(true);
                pKnight.SetActive(true);
                if (pKnight2.activeInHierarchy)
                {
                    pKnight2.SetActive(false);
                }
            }
            if (pSide2 == Knight)
            {
                knightAOE.SetActive(true);
                pKnight2.SetActive(true);
                if (pKnight.activeInHierarchy)
                {
                    pKnight.SetActive(false);
                }
            }
            if (pSide1 != Knight && pSide2 != Knight)
            {
                if (knightAOE != null)
                {
                    knightAOE.SetActive(false);
                }
                pKnight.SetActive(false);
                pKnight2.SetActive(false);
            }
            // KNIGHT PENDANT

            // SHAMROCK PENDANT
            if (pSide1 == Shamrock)
            {
                pShamrock.SetActive(true);
                if (pShamrock2.activeInHierarchy)
                {
                    pShamrock2.SetActive(false);
                }
            }
            if (pSide2 == Shamrock)
            {
                pShamrock2.SetActive(true);
                if (pShamrock.activeInHierarchy)
                {
                    pShamrock.SetActive(false);
                }
            }
            if (pSide1 != Shamrock && pSide2 != Shamrock)
            {
                pShamrock.SetActive(false);
                pShamrock2.SetActive(false);
            }
            // SHAMROCK PENDANT

            //PENDANT EFFECTS


            if (Input.GetKeyDown(KeyCode.L))
            {
                canplay = true;
                if (pCurSide == pSide1)
                {
                    pCurSide = pSide2;
                    return;
                }
                pCurSide = pSide1;
            }


            ////////////////////////////////////////////////MENU///////////////////////////////////////////////////////////////
            if (pendantChoice && pCanvas.activeInHierarchy)
            {
                selectText.text = "Side 1";
            }
            if (!pendantChoice && pCanvas.activeInHierarchy)
            {
                selectText.text = "Side 2";
            }
        }
    }
Пример #10
0
 private void Start()
 {
     magicSystem = PlayerController.singleton.GetComponent <MagicSystem>();
 }