Beispiel #1
0
    void Start()
    {
        this.gameObject.AddComponent <DestructOfBuilding>();
        this.gameObject.AddComponent <Build_Building>();
        this.gameObject.AddComponent <Attack>();

        Attacked attacked = this.gameObject.AddComponent <Attacked>();

        attacked.healthBar = this.gameObject.GetComponentInChildren <HealthBar>();



        attacked.maxHealth = health;

        walk = this.gameObject.AddComponent <Walk>();

        walk.SetAutomaticWalking(enemySoldier);

        walk.speed = speed;
    }