void Awake()
    {
        _instance = this;
        DontDestroyOnLoad(this.gameObject);
        Transform posTransform = GameObject.Find("Player-pos").transform;

        if (PhotonEngine.Instance.role.IsMan)
        {
            playerPrefabName = "CostEngineer_boy";
        }
        else
        {
            playerPrefabName = "CostEngineer_girl";
        }
        GameObject playerGo = GameObject.Instantiate(Resources.Load("Player/" + playerPrefabName)) as GameObject;

        playerGo.transform.position = posTransform.position;
        playerGo.transform.parent   = posTransform.transform;

        taskDbController = GetComponent <TaskDBController>();
        battleController = GetComponent <BattleController>();

        battleController.OnGetTeam += this.OnGetTeam;
        battleController.OnSyncPositionAndRotation += this.OnSyncPositionAndRotation;
        battleController.OnSyncMoveAnimation       += this.OnSyncMoveAnimation;
        battleController.OnSyncPlayerAnimation     += this.OnSyncPlayerAnimation;
        battleController.OnGameStateChange         += this.OnGameStateChange;
    }
Example #2
0
 void Awake()
 {
     instance   = this;
     controller = GameObject.FindGameObjectWithTag("GameController").GetComponent <TaskDBController>();
     tween      = GetComponent <TweenScale>();
     message    = transform.Find("message").GetComponent <UILabel>();
     legend     = transform.Find("legend").GetComponent <UISprite>();
     angel      = transform.Find("angel").GetComponent <UISprite>();
 }
Example #3
0
 void Start()
 {
     taskDBController = this.GetComponent<TaskDBController>();
     taskDBController.OnAddTask += this.OnAddTask;
     taskDBController.OnGetTaskList += this.OnGetTaskList;
     taskDBController.OnUpdateTask += this.OnUpdateTask;
     ReadTaskInfo();
     taskDBController.GetTaskDBList();
 }
Example #4
0
 void Start()
 {
     taskDBController                = this.GetComponent <TaskDBController>();
     taskDBController.OnAddTask     += this.OnAddTask;
     taskDBController.OnGetTaskList += this.OnGetTaskList;
     taskDBController.OnUpdateTask  += this.OnUpdateTask;
     ReadTaskInfo();
     taskDBController.GetTaskDBList();
 }
Example #5
0
 void Awake()
 {
     _instance        = this;
     taskDBController = this.GetComponent <TaskDBController>();
     taskDBController.OnGetTaskDBList += this.OnGetTaskDBList;
     taskDBController.OnAddTaskDB     += this.OnAddTaskDB;
     taskDBController.OnUpdateTaskDB  += this.OnUpdateTaskDB;
     InitTask();
     taskDBController.GetTaskDBList();
 }
Example #6
0
 void Awake()
 {
     instance         = this;
     taskDBController = GetComponent <TaskDBController>();
     taskDBController.OnGetTaskDBList += OnGetTaskDBList;
     taskDBController.OnAddTaskDB     += OnAddTaskDB;
     taskDBController.OnUpdateTaskDB  += OnUpdateTaskDB;
     InitTask();                       //初始化任务
     taskDBController.GetTaskDBList(); //从服务器获取任务列表
 }
Example #7
0
    private void Awake()
    {
        _instance = this;
        taskDBController = this.GetComponent<TaskDBController>();
        taskDBController.OnGetTaskDBList += this.OnGetTaskDBList;
        taskDBController.OnAddTaskDB += this.OnAddTaskDB;
        taskDBController.OnUpdateTaskDB += this.OnUpdateTaskDB;

        InitTask();
        taskDBController.GetTaskDBList();
    }
Example #8
0
 private void Awake()
 {
     _instance = this;
     DontDestroyOnLoad(this.gameObject);
     Transform posTransform = GameObject.Find("Player-pos").transform;
     string playerPrefabName = "Player-girl";
     if (PhotonEngine.Instance.role.IsMan)
     {
         playerPrefabName = "Player-boy";
     }
    GameObject playerGo = GameObject.Instantiate(Resources.Load("Player/" + playerPrefabName)) as GameObject;
     playerGo.transform.position = posTransform.position;
     taskDBController = GetComponent<TaskDBController>();
     battleController = GetComponent<BattleController>();
     battleController.OnGetTeam += this.OnGetTeam;
     battleController.OnSyncPositionAndRotation += this.OnSyncPositionAndRotation;
     battleController.OnSyncMoveAnimation += this.OnSyncMoveAnimation;
     battleController.OnSyncPlayerAnimation += this.OnSyncPlayerAnimation;
     battleController.OnGameStateChange += OnGameStateChange;
 }