Esempio n. 1
0
 //*************************************
 //BEGIN MATERIALS METHODS
 //*************************************
 protected virtual void OnTriggerStay(Collider other)
 {
     if (!constructionHasBegun)
     {
         Spawn   spawn   = other.GetComponentInParent <Spawn>();
         FlyDome flyDome = other.GetComponentInParent <FlyDome>();
         if (spawn == null && flyDome == null)
         {
             WorldObject otherWO = other.GetComponentInParent <WorldObject>();
             if (otherWO == null || (otherWO && otherWO != this.creator))
             {
                 buildingSpaceIsFree = false;
                 if (creator)
                 {
                     SetBuildingMaterial(creator.player.notAllowedMaterial);
                 }
             }
             if (other.gameObject.name == "BuildBlocker")
             {
                 buildingSpaceIsFree = false;
                 if (creator)
                 {
                     SetBuildingMaterial(creator.player.notAllowedMaterial);
                 }
             }
         }
     }
 }
Esempio n. 2
0
    protected virtual void Awake()
    {
        paramManager = GetComponent <ParamManager>();
        worldObject  = GetComponent <WorldObject> ();
        unit         = GetComponent <Unit> ();
        spawner      = this;
        FlyDome dome = GetComponentInParent <FlyDome>();

        if (dome)
        {
            domeCenter = dome.transform.position;
        }
        if (worldObject)
        {
            worldObject.OnWorldObjectDeathDelegate += NotifySpawnsOfDeath;
        }
    }