Example #1
0
    bool CheckCollider(Collider colliderHit)
    {
        // We will just check if the collider has the tag "TowerHolder"
        // and then check if we can actually spawn there.

        // Early exit check
        if (!colliderHit)
        {
            return(false);
        }

        if (colliderHit.tag == "TowerHolder")
        {
            // Keep a copy of the transform.
            towerHolder = colliderHit.gameObject;

            // The line pretty much explains everything.
            HolderUtilities huInstance = colliderHit.gameObject.GetComponent <HolderUtilities> ();
            return(!huInstance.holds);
        }

        return(false);
    }
Example #2
0
    void GiveRemoveCommand()
    {
        HolderUtilities huInstance = towerHolder.GetComponent <HolderUtilities> ();

        huInstance.RemoveTower();
    }
Example #3
0
    void GiveSpawnCommand()
    {
        HolderUtilities huInstance = towerHolder.GetComponent <HolderUtilities> ();

        huInstance.HoldTower(selectedTower);
    }