コード例 #1
0
 protected virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     SharedData.currentLevel = GameConfig.levels.ToList().FindIndex(a => a == scene.name);
     SharedData.gameOver     = false;
     PlayerData.ClearInstace();
     PlayerMoveLine.ClearInstace();
     PlayerMoveCaptured.ClearInstace();
     PlayerMoveEscape.ClearInstace();
     PlayerMoveRotate.ClearInstace();
     if (SharedData.currentLevel <= 2)
     {
         GameObject.Find("Player").AddComponent <TutorPlayerController> ();
         GameObject.Find("StaticTutor").AddComponent <TutorController> ();
     }
     else
     {
         GameObject.Find("Player").AddComponent <PlayerController> ();
     }
     GameObject.Find("Parents").AddComponent <ParentsController> ();
     GameObject.Find("Camera").AddComponent <PlayerCamera> ();
     GameObject.Find("GameUI").AddComponent <GameCompleteController> ();
     try{
         GameObject.Find("Angles").AddComponent <AnglesController>();
     }catch {
     }
     try{
         GameObject.Find("AngelNumber").GetComponent <UnityEngine.UI.Text>().text = "0 / " + GameConfig.angels;
     }catch {
     }
 }
コード例 #2
0
 protected virtual void initMoveDic(PlayerData player)
 {
     movesDic.Add("start", new PlayerMoveStart(player));
     movesDic.Add("line", PlayerMoveLine.Instance(player));
     movesDic.Add("rotate", PlayerMoveRotate.Instance(player));
     movesDic.Add("captured", PlayerMoveCaptured.Instance(player));
     movesDic.Add("escape", PlayerMoveEscape.Instance(player));
 }
コード例 #3
0
    public static PlayerMoveLine Instance(PlayerData gamePlayer)
    {
        if (_instance == null)
        {
            _instance = new PlayerMoveLine(gamePlayer);
        }

        return(_instance);
    }
コード例 #4
0
 public static void ClearInstace()
 {
     _instance = null;
 }