void Awake() { meshRenderer = gameObject.GetComponent <MeshRenderer>(); resourcesScript = resources.GetComponent <ResourceManager>(); cameraFollow = Camera.main.gameObject.GetComponent <CameraFollow>(); actionProduction = gameObject.GetComponent <ActionProduction>(); actionCounter = gameObject.GetComponent <ActionCounter>(); undoController = GameObject.Find("/BottomPlane").GetComponent <UndoController>(); actionTitlePanel = GameObject.Find("/UI/ActionTitle/Panel").GetComponent <Image>(); actionTitleText = GameObject.Find("/UI/ActionTitle/Text").GetComponent <Text>(); actionSubTitleText = GameObject.Find("/UI/ActionTitle/SubText").GetComponent <Text>(); flashScript = gameObject.GetComponent <Flash>(); ToogleTitle(false); }
void Awake() { isAllowedUndo = true; if (Instance == null) { Instance = this; } else if (Instance != this) { DestroyImmediate(gameObject); } Observer.Instance.RegisterListener(ObserverEventID.OnCantUndo, (param) => OnCantUndo()); }