Esempio n. 1
0
 public void CollisionDetected(ChildColliderController childScript)
 {
     if (childScript.gameObject.tag == "CUBE_" + CollisionSide.ToString() && canBeDestroyed)
     {
         Destroy(this.gameObject);
     }
     else
     {
         canBeDestroyed = false;
     }
 }
Esempio n. 2
0
    // GameObject activeSide;

    // GameObject[] children = new GameObject[5];

    // Use this for initialization
    void Start()
    {
        //We iterate through the children and setup the child objects components propertys
        foreach (Transform child in projectile.transform)
        {
            // getChildren(child.gameObject);
            ChildColliderController childComponent = child.GetComponent <ChildColliderController>();
            childComponent.SetParentObject(projectile);
            if (child.gameObject.tag == "CUBE_" + CollisionSide.ToString())
            {
                childComponent.SetActive();
            }
        }
    }