IEnumerator mainRoleCutScene(Vector3 pos) { mRoleCurSceneEnable = true; SMovableObject mainRole = MainGameData.MainRole; while ((mainRole.CurPos - pos).sqrMagnitude > 0.01f) { mainRole.MoveTo(Vector3.Lerp(mainRole.CurPos, pos, 0.1f)); yield return(null); } mainRole.MoveTo(pos); mRoleCurSceneEnable = false; }
// Use this for initialization void Start() { mInput = this.gameObject.AddComponent <SInput>(); InputReceiver inputRecObj = MainRoleModel.AddComponent <InputReceiver>(); SMovableObject moveObj = MainRoleModel.AddComponent <SMovableObject>(); inputRecObj.MovableObject = moveObj; mInput.InputReceiver = inputRecObj; //Camera init gameObject.AddComponent <SCameraMgr>(); //Dungeon init GameObject go = Instantiate(DungeonMgrPrefab) as GameObject; Common.changGOParent(go, gameObject); moveObj.MoveTo(DungeonMgr.Instance.CurRoomPos()); //MainGameData init MainGameData.MainRole = moveObj; }