public void Update()
    {
        ObjectsLoaded getLoaded = GameManager.GetComponentInChildren <ObjectsLoaded>();

        //getLoaded.GmObj.
        GameObject[] temp = GameObject.FindGameObjectsWithTag("Front");

        if (overheadCamera.enabled)
        {
            //gmObj.Add( GameObject.FindGameObjectsWithTag("Top"));
            foreach (GameObject top in temp)
            {
                if (top.activeInHierarchy)
                {
                    top.GetComponent <Renderer>().enabled = true;
                }
            }
        }
        if (firstPersonCamera.enabled)
        {
            //gmObj.Add( GameObject.FindGameObjectsWithTag("Top"));
            foreach (GameObject top in temp)
            {
                if (top.activeInHierarchy)
                {
                    top.GetComponent <Renderer>().enabled = false;
                }
            }
        }
    }
Exemple #2
0
    void OnTriggerEnter(Collider col)
    {
        if (gameObject.tag == "FloorPlaced" && col.gameObject.tag == "CursorFloor")
        {
            UndoList = GameObject.FindGameObjectWithTag("Manager").GetComponent <ObjectsLoaded>();
            if (UndoList != null)
            {
                UndoList.RemoveUndoItem(gameObject);
            }
            Destroy(col.gameObject);
        }
        if (gameObject.tag == "FurnPlaced" && col.gameObject.tag != "FloorPlaced")
        {
            UndoList = GameObject.FindGameObjectWithTag("Manager").GetComponent <ObjectsLoaded>();
            if (UndoList != null)
            {
                UndoList.RemoveUndoItem(gameObject);
            }
            Destroy(gameObject);
        }

        if (gameObject.tag == "SideBeam" && col.gameObject.tag == "SideBeam")
        {
            col.gameObject.GetComponent <Renderer>().enabled = false;
            gameObject.GetComponent <Renderer>().enabled     = false;
        }

        if (gameObject.tag == "WallPlaced" && col.gameObject.tag == "WallPlaced")
        {
            float dist = Vector3.Distance(gameObject.transform.position, col.gameObject.transform.position);
            if (dist < 0.28)
            {
                OrthoCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <WallCreator>();
                UndoList    = GameObject.FindGameObjectWithTag("Manager").GetComponent <ObjectsLoaded>();
                if (OrthoCamera != null)
                {
                    OrthoCamera.RemoveWallItem(gameObject);
                }
                if (UndoList != null)
                {
                    UndoList.RemoveUndoItem(gameObject);
                }
                Destroy(gameObject);
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     objLoad    = target.GetComponent <ObjectsLoaded>();
     scrollList = GameObject.FindGameObjectWithTag("MenuList").GetComponent <ShopScrollList>();
 }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     objLoad    = WorldCenter.GetComponent <ObjectsLoaded>();
     scrollList = GameObject.FindGameObjectWithTag("MenuList").GetComponent <ShopScrollList>();
     wallsList  = new List <WallAdded>();
 }