Esempio n. 1
0
 // Use this for initialization
 public void Start()
 {
     //loading scripts
     hero         = GameObject.FindWithTag("Player");
     heroScript   = hero.GetComponent <HeroMovement> ();
     combatMan    = GameObject.FindGameObjectWithTag("Manager");
     combatScript = combatMan.GetComponent <combatManagerScript> ();
 }
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        hero         = GameObject.FindGameObjectWithTag("Player");              //Initializing gameobjects and scripts.
        heroScript   = hero.GetComponent <HeroMovement> ();
        comMan       = GameObject.FindGameObjectWithTag("Manager");
        combatScript = comMan.GetComponent <combatManagerScript>();

        //enemyTextObject = Find
        texts = GetComponentsInChildren <GUIText>();                    //Figuring out which script belongs to which variable through this array and 4 for-loops, checking for each script name.

        for (int i = 0; i < 4; i++)
        {
            if (texts[i].name == "enemyText")
            {
                enemyText = texts[i];
            }
        }
        for (int i = 0; i < 4; i++)
        {
            if (texts[i].name == "heroText")
            {
                heroText = texts[i];
            }
        }
        for (int i = 0; i < 4; i++)
        {
            if (texts[i].name == "enemyDamText")
            {
                enemyDamText = texts[i];
            }
        }
        for (int i = 0; i < 4; i++)
        {
            if (texts[i].name == "heroDamText")
            {
                heroDamText = texts[i];
            }
        }


        guiTexture.color   = Color.clear;               //Since the game does not start in combat, the text needs to be invisible.
        guiTexture.enabled = false;
        enemyText.color    = Color.clear;
        heroText.color     = Color.clear;
        enemyDamText.color = Color.clear;
        heroDamText.color  = Color.clear;
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        //initializing the combatmanager script, the two music objects and the heros stats
        combatMan          = GameObject.FindGameObjectWithTag("Manager");
        combatScript       = combatMan.GetComponent <combatManagerScript> ();
        CombatMusicHolder  = GameObject.Find("Battle_of_Kings");
        RoamingMusicHolder = GameObject.Find("Anomaly_Detected");

        heroLevel  = 1;
        xp         = 0;
        xpRequired = 100;
        Strength   = 10;
        Toughness  = 10;
        Dexterity  = 10;
        Reflex     = 10;
        Health     = 100;
    }