예제 #1
0
    /*
     * private void RemoveRoom ()
     * {
     *      GameObject _obj = transform.GetChild (0).GetChild (0).gameObject;
     *      IPlacable _placable = _obj.GetComponent <IPlacable> ();
     *      _placable.RemoveObj ();
     * }
     *
     *
     * private void RemoveSystem ()
     * {
     *      GameObject _obj = transform.GetChild (1).GetChild (0).gameObject;
     *      IPlacable _placable = _obj.GetComponent <IPlacable> ();
     *      _placable.RemoveObj ();
     * }
     *
     *
     * private void RemoveCrew ()
     * {
     *      GameObject _obj = transform.GetChild (2).GetChild (0).gameObject;
     *      IPlacable _placable = _obj.GetComponent <IPlacable> ();
     *      _placable.RemoveObj ();
     * }
     */

    /*
     * private void RemoveDanger ()
     * {
     *      //Debug.Log ("Danger Removed at " + GridPosition.X + ", " + GridPosition.Y);
     *
     *      LevelManager.Instance.parameterList.Remove (localDanger);
     *
     *      //meyhap need to redet DangerID...
     *
     *      //GameObject obj = (GameObject)this.GetComponent<GameObject> ().activeInHierarchy;
     *      //GameObject obj = transform.Find("Fire(Clone)").gameObject;
     *
     *      GameObject _obj = transform.GetChild (3).GetChild (0).gameObject;
     *
     *      //obj.SetActive (false);
     *      Destroy (_obj);
     *
     *      OnFire = false;
     *
     *      //probably needs to be replaced
     *      PlacementManager.Instance.Price = 10;
     *
     *      GameManager.Instance.Sell ();
     * }
     */


    private void RemoveSubSystem()
    {
        GameObject _obj      = transform.GetChild(6).GetChild(0).gameObject;
        IPlacable  _placable = _obj.GetComponent <IPlacable> ();

        _placable.RemoveObj();
    }
예제 #2
0
 private void RemoveObj(int _objType)
 {
     //GameObject _obj = transform.GetChild (0).GetChild (0).gameObject;
     if (_objType != 7)
     {
         GameObject _obj      = transform.GetChild(_objType).GetChild(0).gameObject;
         IPlacable  _placable = _obj.GetComponent <IPlacable> ();
         _placable.RemoveObj();
     }
     else if (_objType == 7)
     {
         GameObject _obj      = transform.GetChild(0).gameObject;
         IPlacable  _placable = _obj.GetComponent <IPlacable> ();
         _placable.RemoveObj();
     }
 }