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; }
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>(); }
void Start() { taskDBController = this.GetComponent<TaskDBController>(); taskDBController.OnAddTask += this.OnAddTask; taskDBController.OnGetTaskList += this.OnGetTaskList; taskDBController.OnUpdateTask += this.OnUpdateTask; ReadTaskInfo(); taskDBController.GetTaskDBList(); }
void Start() { taskDBController = this.GetComponent <TaskDBController>(); taskDBController.OnAddTask += this.OnAddTask; taskDBController.OnGetTaskList += this.OnGetTaskList; taskDBController.OnUpdateTask += this.OnUpdateTask; ReadTaskInfo(); taskDBController.GetTaskDBList(); }
void Awake() { _instance = this; taskDBController = this.GetComponent <TaskDBController>(); taskDBController.OnGetTaskDBList += this.OnGetTaskDBList; taskDBController.OnAddTaskDB += this.OnAddTaskDB; taskDBController.OnUpdateTaskDB += this.OnUpdateTaskDB; InitTask(); taskDBController.GetTaskDBList(); }
void Awake() { instance = this; taskDBController = GetComponent <TaskDBController>(); taskDBController.OnGetTaskDBList += OnGetTaskDBList; taskDBController.OnAddTaskDB += OnAddTaskDB; taskDBController.OnUpdateTaskDB += OnUpdateTaskDB; InitTask(); //初始化任务 taskDBController.GetTaskDBList(); //从服务器获取任务列表 }
private void Awake() { _instance = this; taskDBController = this.GetComponent<TaskDBController>(); taskDBController.OnGetTaskDBList += this.OnGetTaskDBList; taskDBController.OnAddTaskDB += this.OnAddTaskDB; taskDBController.OnUpdateTaskDB += this.OnUpdateTaskDB; InitTask(); taskDBController.GetTaskDBList(); }
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; }