// Start is called before the first frame update void Start() { arrived = false; gameState = GameState.playing; action = SceneDirector.GetInstance().CSController as ISceneController; action.LoadResources(); }
void Update() { if (role.isClicked) { SceneDirector.GetInstance().CSController.Move(role); } }
// Start is called before the first frame update void Start() { clickGo = false; arrived = false; gameState = GameState.playing; action = SceneDirector.GetInstance().CSController = new SceneController(); action.LoadResources(); }
public void Update() { frame++; if (frame % 100 == 0) { userGUI.gameState = SceneDirector.GetInstance().CSController.Defeat(); } }
private bool gameStart = false; //游戏开始 void Start() { action = SceneDirector.GetInstance().CSController as IUserAction; style1.normal.textColor = Color.black; style1.fontSize = 31; style2.normal.textColor = Color.red; style2.fontSize = 31; buttonStyle.fontSize = 29; }
// Update is called once per frame void Update() { if (clickGo) { gameState = SceneDirector.GetInstance().CSController.MoveAll(out arrived); } if (arrived) { clickGo = false; } }
public void OnMouseDown() { if (Role.clickable) { Role.clickable = false; role.isClicked = true; } if (role.isClicked) { SceneDirector.GetInstance().CSController.Move(role); } }
public void Awake() { SceneDirector.GetInstance().CSController = this; actionManager = GetComponent <CCActionManager>() as CCActionManager; BFSsolution solver = new BFSsolution(); Node beginNode = new Node(3, 3, true, 3, 3); currentNode = beginNode; endNode = new Node(0, 0, false, 3, 3); this.solutionPath = solver.BFSearch(beginNode, endNode); }
void OnGUI() { GUIStyle button_style; button_style = new GUIStyle("button") { fontSize = 50 }; if (gameState == GameState.playing) { if (GUI.Button(new Rect(Screen.width / 2.1f, Screen.height / 8, 150, 70), "Go", button_style)) { SceneDirector.GetInstance().CSController.MoveAll(out arrived); } if (GUI.Button(new Rect(Screen.width / 2.1f - 75, Screen.height / 4, 300, 70), "AI select", button_style)) { SceneDirector.GetInstance().CSController.solverMove(); } } else if (gameState == GameState.win) { if (GUI.Button(new Rect(Screen.width / 2.4f, Screen.height / 3.5f, 450, 170), "You Won \nplay again", button_style)) { clickGo = false; arrived = false; gameState = GameState.playing; action.DestoryResources(); action.LoadResources(); } } else if (gameState == GameState.defeat) { if (GUI.Button(new Rect(Screen.width / 2.4f, Screen.height / 3.5f, 450, 170), "You Lost\nplay again", button_style)) { clickGo = false; arrived = false; gameState = GameState.playing; action.DestoryResources(); action.LoadResources(); } } }
protected void Start() { Debug.Log(this.GetInstanceID()); sceneController = (FirstController)SceneDirector.GetInstance().CSController; sceneController.actionManager = this; }
void Awake() { SceneDirector director = SceneDirector.GetInstance(); director.CSController = this; }
public void Awake() { SceneDirector.GetInstance().CSController = this; actionManager = GetComponent <CCActionManager>() as CCActionManager; }
public void Update() { userGUI.gameState = SceneDirector.GetInstance().CSController.Defeat(); }