Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     arrived   = false;
     gameState = GameState.playing;
     action    = SceneDirector.GetInstance().CSController as ISceneController;
     action.LoadResources();
 }
Example #2
0
 void Update()
 {
     if (role.isClicked)
     {
         SceneDirector.GetInstance().CSController.Move(role);
     }
 }
Example #3
0
 // 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();
 }
Example #4
0
 public void Update()
 {
     frame++;
     if (frame % 100 == 0)
     {
         userGUI.gameState = SceneDirector.GetInstance().CSController.Defeat();
     }
 }
Example #5
0
    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;
    }
Example #6
0
 // Update is called once per frame
 void Update()
 {
     if (clickGo)
     {
         gameState = SceneDirector.GetInstance().CSController.MoveAll(out arrived);
     }
     if (arrived)
     {
         clickGo = false;
     }
 }
Example #7
0
 public void OnMouseDown()
 {
     if (Role.clickable)
     {
         Role.clickable = false;
         role.isClicked = true;
     }
     if (role.isClicked)
     {
         SceneDirector.GetInstance().CSController.Move(role);
     }
 }
Example #8
0
    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);
    }
Example #9
0
    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();
            }
        }
    }
Example #10
0
 protected void Start()
 {
     Debug.Log(this.GetInstanceID());
     sceneController = (FirstController)SceneDirector.GetInstance().CSController;
     sceneController.actionManager = this;
 }
Example #11
0
    void Awake()
    {
        SceneDirector director = SceneDirector.GetInstance();

        director.CSController = this;
    }
Example #12
0
 public void Awake()
 {
     SceneDirector.GetInstance().CSController = this;
     actionManager = GetComponent <CCActionManager>() as CCActionManager;
 }
Example #13
0
 public void Update()
 {
     userGUI.gameState = SceneDirector.GetInstance().CSController.Defeat();
 }