// Use this for initialization void Start() { clickedobject = this.GetComponent <Clicked> (); gl = GameObject.Find("ScriptGlobal").GetComponent <Global> (); pa = this.GetComponent <PlayAnimations> (); ins = this.GetComponent <InventorySystem> (); zio = this.GetComponent <ZoomInOut> (); dt = this.GetComponent <DragTurn> (); if (go == null) { go = this.gameObject; } }
public void ClearTurnFlags() { GameObject[] gameobjs = GetAllGameObjectsChilds(GameObject.Find("ScriptGlobal")).ToArray(); foreach (GameObject go in gameobjs) { try { DragTurn DT = go.GetComponent <DragTurn>(); if (DT.isRotating || DT.mayRotate || DT.timer != -1) { Debug.Log("A Turn Flag was Cleared."); } DT.isRotating = false; DT.mayRotate = false; DT.timer = -1; } catch {} } }