Ejemplo n.º 1
0
 public void reset()
 {
     // moveableScript.reset();
     coastController = (Director.getInstance().currentSceneController as FirstController).fromCoast;
     getOnCoast(coastController);
     setPosition(coastController.getEmptyPosition());
     coastController.getOnCoast(this);
 }
Ejemplo n.º 2
0
        public void loadResources()
        {
            GameObject water = Instantiate(Resources.Load("Perfabs/Water", typeof(GameObject)), water_pos, Quaternion.identity, null) as GameObject;

            water.name = "water";

            fromCoast = new CoastController(1);
            toCoast   = new CoastController(-1);
            boat      = new BoatController();

            loadCharacter();
        }
Ejemplo n.º 3
0
        public void characterIsClicked(MyCharacterController characterCtrl)
        {
            // actionManager.select = characterCtrl;
            //  actionManager.chamove(characterCtrl);
            if (characterCtrl.isOnBoat())
            {
                CoastController whichCoast;
                if (boat.get_to_or_from() == -1)
                { // to->-1; from->1
                    whichCoast = toCoast;
                }
                else
                {
                    whichCoast = fromCoast;
                }

                boat.GetOffBoat(characterCtrl.getName());
                actionManager.moveCharacter(characterCtrl, whichCoast.getEmptyPosition());
                //  characterCtrl.moveToPosition(whichCoast.getEmptyPosition());
                characterCtrl.getOnCoast(whichCoast);
                whichCoast.getOnCoast(characterCtrl);
            }
            else
            {                                   // character on coast
                CoastController whichCoast = characterCtrl.getCoastController();

                if (boat.getEmptyIndex() == -1)
                {       // boat is full
                    return;
                }

                if (whichCoast.get_to_or_from() != boat.get_to_or_from())   // boat is not on the side of character
                {
                    return;
                }

                whichCoast.getOffCoast(characterCtrl.getName());
                actionManager.moveCharacter(characterCtrl, boat.getEmptyPosition());
                // characterCtrl.moveToPosition(boat.getEmptyPosition());
                characterCtrl.getOnBoat(boat);
                boat.GetOnBoat(characterCtrl);
            }
            userGUI.status = check_game_over();
        }
Ejemplo n.º 4
0
 public void getOnCoast(CoastController coastCtrl)
 {
     coastController            = coastCtrl;
     character.transform.parent = null;
     _isOnBoat = false;
 }
Ejemplo n.º 5
0
 public void getOnBoat(BoatController boatCtrl)
 {
     coastController            = null;
     character.transform.parent = boatCtrl.getGameobj().transform;
     _isOnBoat = true;
 }