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(new Vector3(9, 1, 0));
        toCoast    = new CoastController(new Vector3(-9, 1, 0));
        for (int i = 0; i < 6; i++)
        {
            MyCharacterController mc;
            if (i < 3)
            {
                mc = new MyCharacterController(CharacterType.Devil);
            }
            else
            {
                mc = new MyCharacterController(CharacterType.Priest);
            }
            characters[i] = mc;
            var _pos = fromCoast.getEmptyPosition();
            mc.setPosition(_pos);
            mc.getOnCoast(fromCoast.getGameobj(), _pos, CharacterPosition.From);
            fromCoast.addCharacter(mc);
        }
        boat          = new BoatController(boatFromPosition, boatToPosition);
        userGui.state = GameState.NotWin;
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
    }
Exemplo n.º 2
0
 void Start()
 {
     Debug.Log("First SceneController Start!");
     gameGUI       = gameObject.AddComponent <pageImage>() as pageImage;
     actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
     this.gameObject.AddComponent <DiskFactory>();
 }
Exemplo n.º 3
0
        public override void onEnter()
        {
            //
            // This test MUST be done in 'onEnter' and not on 'init'
            // otherwise the paused action will be resumed at 'onEnter' time
            //
            base.onEnter();

            CCSize s = CCDirector.sharedDirector().getWinSize();

            CCLabelTTF l = CCLabelTTF.labelWithString("After 5 seconds grossini should move", "Arial", 16);

            addChild(l);
            l.position = (new CCPoint(s.width / 2, 245));


            //
            // Also, this test MUST be done, after [super onEnter]
            //
            CCSprite grossini = CCSprite.spriteWithFile(s_pPathGrossini);

            addChild(grossini, 0, kTagGrossini);
            grossini.position = (new CCPoint(200, 200));

            CCAction action = CCMoveBy.actionWithDuration(1, new CCPoint(150, 0));

            CCActionManager.sharedManager().addAction(action, grossini, true);

            schedule(unpause, 3);
        }
Exemplo n.º 4
0
        public void unpause(float dt)
        {
            unschedule(unpause);
            CCNode node = getChildByTag(kTagGrossini);

            CCActionManager.sharedManager().resumeTarget(node);
        }
Exemplo n.º 5
0
 void Awake()
 {
     Director.getInstance().currentSceneController = this;
     guiCtrl       = gameObject.AddComponent <FirstSceneGuiCtrl>() as FirstSceneGuiCtrl;
     actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
     loadResources();
 }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     Factory       = Singleton <PatrolFactory> .Instance;
     ActionManager = Singleton <CCActionManager> .Instance;
     LoadPatrol();
     //OnStartServer();
     Debug.Log("1");
 }
Exemplo n.º 7
0
        public void resumeGrossini(float time)
        {
            this.unschedule(resumeGrossini);

            CCNode pGrossini = getChildByTag((int)KTag.kTagGrossini);

            CCActionManager.sharedManager().resumeTarget(pGrossini);
        }
Exemplo n.º 8
0
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentScenceController = this;
        DF      = DiskFactory.DF;
        Manager = GetComponent <CCActionManager>();
    }
Exemplo n.º 9
0
    /*initial period*/
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.setFPS(60);
        director.currentScenceController = this;
        director.currentScenceController.GenGameObject();
        actionManager = GetComponent <CCActionManager> ();
    }
Exemplo n.º 10
0
    private int score_round3  = 25;                                          //去到第三回合所需分数

    void Start()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        disk_factory = Singleton <DiskFactory> .Instance;
        am           = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        user_gui     = gameObject.AddComponent <UserGUI>() as UserGUI;
    }
Exemplo n.º 11
0
    public void getOffBoat(environmentController envCtrl, CCActionManager actionManager)
    {
        status = "shore";
        people.transform.parent = null;
        Vector3         aim        = envCtrl.getPosVec(size, number);
        CCPeopleMoveing peopleMove = CCPeopleMoveing.GetSSAction(aim);

        actionManager.RunAction(people, peopleMove, null);
    }
Exemplo n.º 12
0
    public void reset(environmentController envCtrl, CCActionManager actionManager)
    {
        size   = defaultSize;
        status = "shore";
        people.transform.parent = null;
        CCPeopleMoveing peopleMove = CCPeopleMoveing.GetSSAction(envCtrl.getPosVec(size, number));

        actionManager.RunAction(people, peopleMove, null);
    }
Exemplo n.º 13
0
    public void getOnBoat(boatController boatCtrl, CCActionManager actionManager)
    {
        status = "boat";
        people.transform.parent = boatCtrl.getBoat().transform;
        Vector3         aim        = boatCtrl.getBoatPos(getName());
        CCPeopleMoveing peopleMove = CCPeopleMoveing.GetSSAction(aim);

        actionManager.RunAction(people, peopleMove, null);
    }
Exemplo n.º 14
0
    public void reset(CCActionManager actionManager)
    {
        nameOfPeopleOnBoat [0] = nameOfPeopleOnBoat [1] = "";
        size = defaultSize;
        CCBoatMoveing boatMove = CCBoatMoveing.GetSSAction();

        boatMove.aim = rightPos;
        actionManager.RunAction(boat, boatMove, null);
        size = "right";
    }
Exemplo n.º 15
0
    void Awake()

    {
        SSDirector director = SSDirector.getInstance();

        director.setFPS(60);
        director.currentScenceController = this;
        director.currentScenceController.LoadResources();
        actionManager = new CCActionManager();
    }
Exemplo n.º 16
0
    // the first scripts
    void Awake()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentSceneController = this;
        director.CurrentSceneController.LoadResources();
        usergui       = gameObject.AddComponent <UserGUI>() as UserGUI;
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        actionManager.Start();
    }
Exemplo n.º 17
0
    List <GameObject> no_shot_list = new List <GameObject>();    //未被击中的飞碟列表

    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        this.gameObject.AddComponent <UFOFactory>();
        ufo_factory = Singleton <UFOFactory> .Instance;
        am          = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        user_gui    = gameObject.AddComponent <UserGUI>() as UserGUI;
        this.LoadResources();
    }
Exemplo n.º 18
0
    void Start()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        loadResources();
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        judge         = gameObject.AddComponent <Judge>() as Judge;
        judge.setJudge(characters, boat, this);
        status = GameStatus.playing;
    }
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        user = gameObject.AddComponent <UserGUI> () as UserGUI;                 //添加UserGUI脚本作为组件
        //characters = new MyCharacterController[6];
        team    = new List <MyCharacterController>();
        manager = gameObject.AddComponent <CCActionManager> () as CCActionManager;
        LoadResource();
    }
Exemplo n.º 20
0
    void Awake()
    {
        Director director = Director.getInstance();

        director.currentSceneController = this;
        userGUI       = gameObject.AddComponent <UserGUI>() as UserGUI;
        characters    = new Character[6];
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        ifGameover    = false;
        LoadResources();
    }
Exemplo n.º 21
0
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        userGUI = gameObject.AddComponent <UserGUI>() as UserGUI;
        am      = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        judge   = gameObject.AddComponent <Judge>() as Judge;
        role    = new RoleModel[6];
        director.currentSceneController.LoadResources();
    }
    public bool gaming = true; //用于判断游戏是否正在进行,由于目前还不存在起始界面,所以一开始游戏就开始了

    void Awake()
    {
        speed = 4;
        SSDirector director = SSDirector.GetInstance();

        director.CurrentSceneController = this;
        userGui = gameObject.AddComponent <UserGUI>() as UserGUI;
        director.CurrentSceneController.LoadResource();

        judger        = gameObject.AddComponent <Judger>() as Judger;
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
    }
    void Awake()
    {
        SSDirector director = SSDirector.GetInstance();

        director.CurrentSceneController = this;

        diskFactory   = Singleton <DiskFactory> .Instance;
        userGui       = gameObject.AddComponent <UserGUI>() as UserGUI;
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;

        scoreRecorder = new ScoreRecorder();
    }
Exemplo n.º 24
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);
    }
Exemplo n.º 25
0
 // Start is called before the first frame update
 void Start()
 {
     ssd = SSDirector.GetInstance();
     ssd.SetModel(this);
     manager1 = GetComponent <CCActionManager>() as CCActionManager;
     referee1 = GetComponent <Referee>() as Referee;
     // Correct(Boat, new Vector3(3, 0.8f, 10));
     Build();
     Correct(RightPriests, new Vector3(4.6f, 0.8f, 10));
     Correct(RightDevils, new Vector3(6.2f, 0.8f, 10));
     Correct(LeftPriests, new Vector3(-5.6f, 0.8f, 10));
     Correct(LeftDevils, new Vector3(-7.6f, 0.8f, 10));
 }
    private int gameJudge;     // 0-> ingame, 1-> win, -1->lose
    // public GameObject collider1;
    // Use this for initialization
    void Awake()
    {
        //Debug.Log("FPS " + Application.targetFrameRate);
        Application.targetFrameRate = 30;
        SSDirector director = SSDirector.GetInstance();

        director.currentSceneController = this;
        patrolFactory = Singleton <PatrolFactory> .Instance;
        actionManager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        userGUI       = gameObject.AddComponent <UserGUI>() as UserGUI;
        timer         = gameObject.AddComponent <Timer>() as Timer;
        LoadResources();
    }
Exemplo n.º 27
0
    void Start()
    {
        score     = 0;
        gameState = GameState.playing;

        patrol_factory = Singleton <Factory> .Instance;
        action_manager = gameObject.AddComponent <CCActionManager>() as CCActionManager;
        LoadResources();
        for (int i = 0; i < patrols.Count; i++)
        {
            action_manager.GoPatrol(patrols[i]);
        }
        main_camera.GetComponent <CameraFlow>().follow = player;
    }
Exemplo n.º 28
0
    //初始化游戏场景和配置。
    void Awake()
    {
        Director.getInstance().currentSceneController = this;
        userGUI       = gameObject.AddComponent <UserGUI>() as UserGUI;
        people        = new ChaController[6];
        actionManager = new CCActionManager();

        audioSource        = this.gameObject.GetComponent <AudioSource>();
        audioSource.loop   = false;
        audioSource.volume = 1.0f;
        audioSource.clip   = audio;

        LoadResources();
    }
Exemplo n.º 29
0
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.currentSceneController = this;
        patrolFactory = PatrolFactory.patrolFactory;
        actionManager = gameObject.AddComponent <CCActionManager>();
        LoadResources();

        if (player.GetComponent <Rigidbody>())
        {
            player.GetComponent <Rigidbody>().freezeRotation = true;
        }
    }
    void Awake()
    {
        SSDirector director = SSDirector.getInstance();

        director.setFPS(60);
        director.currentSceneController = this;
        director.currentSceneController.LoadResources();
        boarding_num       = 0;
        curr_boat          = A;
        status             = UNDEFINE;
        this.buttonActive  = true;
        this.actionManager = new CCActionManager();
        this.referee       = new SSReferee();
        this.referee.Start();
    }