void Awake()
 {
     uStationary = gameObject.GetComponentInParent <UnitStationary>();
     enemyTeams  = uStationary.enemyTeams;
     team        = uStationary.team;
     enemyTeams.Remove(team);
     enemyTargets = new List <Unit>();
 }
Beispiel #2
0
    void Awake()
    {
        towerInfo = GetComponent <Unit>();
        towerInfo.Init("Tower", "Tower", tag, 1, 3000.0, 0, 0, 100, 2, 1f, 0f, 30, 2, 0, 0, 500, 0, 0, 0, 0, 0, 150, 0, 300, 0);
        uStationary = GetComponent <UnitStationary>();
        uStationary.U2UMState(UnitStationary.AttackState.ATTACKFIRST);

        towerTransform = gameObject.transform;
        towerTop       = towerTransform.FindChild("TowerTop").transform.FindChild("TowerShooter");
        firePosition   = towerTop.FindChild("FirePosition");

        backgroundTexture = new Texture2D(1, 1, TextureFormat.RGB24, false);
        backgroundTexture.SetPixel(0, 0, Color.black);
        backgroundTexture.Apply();

        healthTexture = new Texture2D(1, 1, TextureFormat.RGB24, false);
        healthTexture.SetPixel(0, 0, Color.green);
        healthTexture.Apply();
    }