Esempio n. 1
0
    protected void InitSupportClasses()
    {
        Debug.Log(baseStats.type + " | " + baseStats.moveCosts);

        //Initialize Sight Class
        sight = this.gameObject.AddComponent <UnitSight>();
        Debug.Log(this + " | " + sight + " | " + overlord + " | " + assets + " | " + mainMap + " | " + baseStats.sight);
        sight.InitSight(this, overlord, assets.sightSphere, baseStats.sight, mainMap.tileWidth);

        //Initialize Movement Class
        move = this.gameObject.AddComponent <UnitMovement> ();
        move.InitMovement(mainMap, assets, baseStats.speed, baseStats.moveCosts, tileLocation, con);

        //Initialize Selection Class
        selection = this.gameObject.AddComponent <UnitSelection> ();
        selection.InitSelection(this);

        //initialize body trigger
        bodyTrig.Init(this, mainMap);
    }