Example #1
0
    void Awake()
    {
        Director director = Director.getInstance();

        director.currentSceneController = this;
        characters = new Character[6];
        loadResources();
        simplegui     = gameObject.AddComponent <simpleGUI>() as simpleGUI;
        actionManager = GetComponent <FirstSceneActionManager>();
    }
Example #2
0
    private Judgment judgment;                       //添加裁判
    void Awake()
    {
        Director director = Director.getInstance();

        director.currentSceneController = this;
        userGUI    = gameObject.AddComponent <UserGUI>() as UserGUI;
        characters = new MyCharacterController[6];

        myActionManager           = gameObject.AddComponent <FirstSceneActionManager>() as FirstSceneActionManager; //动作管理器部件获取
        judgment                  = gameObject.AddComponent <Judgment>() as Judgment;                               //裁判获取
        camera                    = GameObject.Find("Main Camera");
        camera.transform.position = new Vector3(0, 3, -15);
        loadResources();
    }
Example #3
0
    public void loadResources()
    {
        GameObject river = Instantiate(Resources.Load("Prefabs/river"), new Vector3(0, -12, 0), Quaternion.identity) as GameObject;

        boat      = new BoatController();
        boat.boat = Instantiate(Resources.Load("Prefabs/boat"), new Vector3(-5, -2, 0), Quaternion.identity) as GameObject;
        boat.boat.AddComponent(typeof(ClickGUI));
        boat.setName("boat");
        //boat.move = boat.boat.AddComponent(typeof(Move)) as Move;

        leftBank      = new BankController("left");
        leftBank.bank = Instantiate(Resources.Load("Prefabs/leftBank"), new Vector3(-12, (float)-1.5, 0), Quaternion.identity) as GameObject;

        rightBank      = new BankController("right");
        rightBank.bank = Instantiate(Resources.Load("Prefabs/rightBank"), new Vector3(12, (float)-1.5, 0), Quaternion.identity) as GameObject;

        characters = new CharactersController[6];
        for (int i = 0; i < 3; i++)
        {
            characters[i]           = new CharactersController("devil", i);
            characters[i].character = Instantiate(Resources.Load("Prefabs/devil"), Vector3.zero, Quaternion.identity) as GameObject;
            characters[i].setName("devil" + i);
            characters[i].character.transform.position = new Vector3((float)(-14 + i), (float)-0.5, 0);
            leftBank.putACharacter(characters[i]);

            characters[i].clickGUI = characters[i].character.AddComponent(typeof(ClickGUI)) as ClickGUI;
            characters[i].clickGUI.setController(characters[i]);
            //characters[i].move = characters[i].character.AddComponent(typeof(Move)) as Move;
        }
        for (int i = 3; i < 6; i++)
        {
            characters[i]           = new CharactersController("priest", i);
            characters[i].character = Instantiate(Resources.Load("Prefabs/priest"), Vector3.zero, Quaternion.identity) as GameObject;
            characters[i].setName("priest" + i);
            characters[i].character.transform.position = new Vector3((float)(-14 + i), (float)-0.5, 0);
            leftBank.putACharacter(characters[i]);

            characters[i].clickGUI = characters[i].character.AddComponent(typeof(ClickGUI)) as ClickGUI;
            characters[i].clickGUI.setController(characters[i]);
            //characters[i].move = characters[i].character.AddComponent(typeof(Move)) as Move;
        }

        judgment        = new Judgment();
        myActionManager = gameObject.AddComponent <FirstSceneActionManager>() as FirstSceneActionManager;
    }
Example #4
0
    void Awake()
    {
        // 挂载各种控制组件

        director = Director.getInstance();
        director.currentSceneController = this;

        actionManager = gameObject.AddComponent <FirstSceneActionManager>();

        UFOfactory = gameObject.AddComponent <UFOFactory>();

        explosionFactory = gameObject.AddComponent <ExplosionFactory>();

        scorer            = Scorer.getInstance();
        difficultyManager = DifficultyManager.getInstance();


        loadResources();
    }
 void Start()
 {
     actionManager = GetComponent <FirstSceneActionManager>();
 }
Example #6
0
    private FirstSceneActionManager FCActionManager; //动作场景控制器

    void Start()
    {
        FCActionManager = GetComponent <FirstSceneActionManager>(); //初始化
        judge           = new Judge(fromCoast, toCoast, boat);      //初始化裁判类
    }