Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MD5Hash:dd523edd0dc32eedfba09cb22f8d6854;
- using UnityEngine;
- using System;
- public class GameLogic : UnityEngine.MonoBehaviour
- {
- public UnityEngine.Material Material_Black_Icon = null;
- public UnityEngine.Material Material_Black = null;
- void Start()
- {
- }
- void Update()
- {
- }
- public void Btn_BuildMenu()
- {
- Check_BuildZones(3, 4, false, true);
- }
- public void Check_BuildZones(int X_Index, int Y_Index, bool Elevator, bool Activate_Build_Zone)
- {
- int _One = 1;
- UnityEngine.GameObject _Temp_GameObject_1 = null;
- UnityEngine.GameObject _Temp_GameObject_2 = null;
- UnityEngine.GameObject _Temp_GameObject_3 = null;
- UnityEngine.GameObject _Temp_GameObject_4 = null;
- bool _Active_Build_Zone = false;
- _Active_Build_Zone = Activate_Build_Zone;
- if (Elevator)
- {
- ///Find adjacent objects
- _Temp_GameObject_3 = UnityEngine.GameObject.Find("Plane_X_" + X_Index.ToString() + "_Y_" + (Y_Index + _One).ToString() + "(Clone)");
- _Temp_GameObject_4 = UnityEngine.GameObject.Find("Plane_X_" + X_Index.ToString() + "_Y_" + (Y_Index - _One).ToString() + "(Clone)");
- ///Checks if neighbor objects aviable (=!Null)
- ///Checks if neighbor objects aviable (=!Null)
- if (_Temp_GameObject_3 == null)
- {
- }
- else
- {
- ///Get Render Component from Panel Container
- _Temp_GameObject_3.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>();
- ///Set or Unset Material
- if (_Active_Build_Zone)
- {
- ///Set or Unset Material
- _Temp_GameObject_3.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black_Icon;
- }
- else
- {
- ///Set or Unset Material
- _Temp_GameObject_3.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black;
- }
- }
- ///Checks if neighbor objects aviable (=!Null)
- if (_Temp_GameObject_4 == null)
- {
- }
- else
- {
- ///Get Render Component from Panel Container
- _Temp_GameObject_4.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>();
- ///Set or Unset Material
- if (_Active_Build_Zone)
- {
- ///Set or Unset Material
- _Temp_GameObject_4.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black_Icon;
- }
- else
- {
- ///Set or Unset Material
- _Temp_GameObject_4.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black;
- }
- }
- }
- else
- {
- ///Find adjacent objects
- _Temp_GameObject_2 = UnityEngine.GameObject.Find("Plane_X_" + (X_Index - _One).ToString() + "_Y_" + Y_Index.ToString() + "(Clone)");
- _Temp_GameObject_1 = UnityEngine.GameObject.Find("Plane_X_" + (X_Index + _One).ToString() + "_Y_" + Y_Index.ToString() + "(Clone)");
- ///Checks if neighbor objects aviable (=!Null)
- ///Checks if neighbor objects aviable (=!Null)
- if (_Temp_GameObject_1 == null)
- {
- }
- else
- {
- ///Get Render Component from Panel Container
- _Temp_GameObject_1.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>();
- ///Set or Unset Material
- if (_Active_Build_Zone)
- {
- ///Set or Unset Material
- _Temp_GameObject_1.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black_Icon;
- }
- else
- {
- ///Set or Unset Material
- _Temp_GameObject_1.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black;
- }
- }
- ///Checks if neighbor objects aviable (=!Null)
- if (_Temp_GameObject_2 == null)
- {
- }
- else
- {
- ///Get Render Component from Panel Container
- _Temp_GameObject_2.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>();
- ///Set or Unset Material
- if (_Active_Build_Zone)
- {
- ///Set or Unset Material
- _Temp_GameObject_2.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black_Icon;
- }
- else
- {
- ///Set or Unset Material
- _Temp_GameObject_2.transform.GetChild(0).gameObject.GetComponent<UnityEngine.Renderer>().material = Material_Black;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement