Exemplo n.º 1
0
 public static Vector3 GetTerrainBornPoint(float curHeight)
 {
     if (DataReader <Scene> .Contains(MySceneManager.Instance.CurSceneID))
     {
         Vector2 point = MapDataManager.Instance.GetPoint(MySceneManager.Instance.CurSceneID, DataReader <Scene> .Get(MySceneManager.Instance.CurSceneID).pointId);
         return(MySceneManager.GetTerrainPoint(point.x * 0.01f, point.y * 0.01f, curHeight));
     }
     return(Vector3.get_zero());
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     sceneManager   = this.GetComponent <MySceneManager>();
     comboTimer     = this.GetComponent <ComboTimer>();
     scoreText.text = "Score: " +
                      sceneManager.score + "\nMoves: " +
                      sceneManager.numberOfMoves + "\nCombo Timer: " +
                      (int)comboTimer.comboEndTime
     ;
 }
Exemplo n.º 3
0
 void Awake()
 {
     if (null == instance)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
         _alphaImg       = GetComponent <Image>();
         _alphaImg.color = new Color(0f, 0f, 0f, 0f);
     }
 }
    private void Start()
    {
        charManager     = CharacterManager.GetInstance();
        numberOfPlayers = charManager.numberOfUsers;


        sceneManager = MySceneManager.GetInstance();

        charManager.solo = (numberOfPlayers == 1);
    }
Exemplo n.º 5
0
    public static bool GetTerrainBornPoint(float curHeight, out Vector3 result)
    {
        if (!DataReader <Scene> .Contains(MySceneManager.Instance.CurSceneID))
        {
            result = Vector3.get_zero();
            return(false);
        }
        Vector2 point = MapDataManager.Instance.GetPoint(MySceneManager.Instance.CurSceneID, DataReader <Scene> .Get(MySceneManager.Instance.CurSceneID).pointId);

        return(MySceneManager.GetTerrainPoint(point.x * 0.01f, point.y * 0.01f, curHeight, out result));
    }
Exemplo n.º 6
0
    void Update()
    {
        rabit_pos = HeroRabit.lastRabit.transform.position;
        my_pos    = this.transform.position;


        if (Vector3.Distance(rabit_pos, my_pos) < 1.5)
        {
            MySceneManager.loadScene("Level" + level);
        }
    }
    void OnTriggerEnter(Collider collider)
    {
        var playerController = collider.GetComponent <PlayerController>();

        if (playerController == null)
        {
            return;
        }

        MySceneManager.LoadScene(SceneType.Level1);
    }
Exemplo n.º 8
0
 public override void increaseLand(PlayerStatus aMyStatus, LandMass aLand, GameMaster mMaster, Action <bool> aCallback)
 {
     MySceneManager.openScene("twoChoicesQuestion",
                              new Arg(new Dictionary <string, object>()
     {
         { "text", aLand.mIncreaseCost.ToString() + "金で" + aLand.mNameMesh.text + "を\n増資しますか" }
     }),
                              null, (aArg) => {
         aCallback(aArg.get <bool>("answer"));
     });
 }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     if (GetComponent <ItemOnObject> ().item.itemName == "Ladder")
     {
         sm = GameObject.Find("SceneManager").GetComponent <MySceneManager> ();
     }
     else
     {
         this.enabled = false;
     }
 }
Exemplo n.º 10
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.R) || Input.GetButtonDown("Fire2"))
     {
         MySceneManager.ReloadStage(); // this does not even like remotely belong here.
     }
     else
     {
         RegularControls();
     }
 }
Exemplo n.º 11
0
    void Start()
    {
        SoundManager.Instance.playBGM(0);

        nextStageButton.GetComponent <Button>().onClick.AddListener(() => {
            GameManager.changeStage(GameManager.StageNum + 1);
        });
        stageSelectButton.GetComponent <Button>().onClick.AddListener(() => {
            MySceneManager.changeScene(SceneNames.StageSelect);
        });
    }
Exemplo n.º 12
0
    void Awake()
    {
        _mySceneManager = GameObject.Find("MySceneManager").GetComponent <MySceneManager> ();
        if (_textConnectionState == null)
        {
            _textConnectionState = GameObject.Find("TextConnectionState").GetComponent <Text> ();
        }

        // 接続
        PhotonNetwork.ConnectUsingSettings("v0.1");
    }
Exemplo n.º 13
0
    public void RequestAISnapshot(AICharacter t)
    {
        int index = MySceneManager.GetInstance().progIndex;

        if (index > ai_stats.Count - 1)
        {
            index = ai_stats.Count - 1;
        }

        SetAIStats(index, t);
    }
Exemplo n.º 14
0
 // Start is called before the first frame update
 void Start()
 {
     sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>();
     if (flag == "keyCard")
     {
         if (sceneManager.keyCardBrought == true)
         {
             Destroy(gameObject);
         }
     }
 }
Exemplo n.º 15
0
 //会話ウィンドウを閉じる
 static public void close(Action aCallback)
 {
     if (mConversationMain == null)//既に閉じられている
     {
         aCallback();
         return;
     }
     mConversationMain = null;
     MySceneManager.closeScene("conversation", new Arg(), (_) => {
         aCallback();
     });
 }
Exemplo n.º 16
0
 // Start is called before the first frame update
 void Start()
 {
     sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>();
     mText        = GetComponent <Text>();
     //Replaced all the "^" to next line character
     for (int i = 0; i < texts.Length; i++)
     {
         texts[i] = texts[i].Replace('^', '\n');
     }
     currentText = texts[0];
     StartCoroutine(BuildText());
 }
Exemplo n.º 17
0
 // Start is called before the first frame update
 void Start()
 {
     Subject.addObserver(new Observer("titleMain", (a) => {
         if (a.name == "new")
         {
             MySceneManager.changeScene("gameConfig");
         }
         else if (a.name == "continue")
         {
         }
     }));
 }
Exemplo n.º 18
0
    public void MinusLight()
    {
        HaloLight.range     -= AddHaloAmount;
        HaloLight.intensity -= AddHaloAmount;

        if (HaloLight.intensity <= 0)
        {
            MySceneManager MySceneManagerScript = MySceneManaObj.GetComponent <MySceneManager>();

            MySceneManagerScript.RestartLevel();
        }
    }
    public void WinState()
    {
        if (charManager.solo)
        {
            sceneManager.progressionBase++;
        }

        if (sceneManager.progressionBase == 2 && charManager.solo)
        {
            MySceneManager.GetInstance().RequestLevelLoad(SceneType.prog, "GameOver");
        }
    }
Exemplo n.º 20
0
 // Update is called once per frame
 void Update()
 {
     if (_loading == null)
     {
         return;
     }
     if (_loading.isDone)
     {
         _loading = null;
         MySceneManager.OnLoadingDone();
     }
 }
Exemplo n.º 21
0
    void Start()
    {
        Arg tArg = MySceneManager.getArg("play");
        //Arg tArg = new Arg(new Dictionary<string, object>() { { "file", "kawaikunaritai" }, { "difficult", "guru" } });
        string         tFileName  = tArg.get <string>("file");
        ScoreDifficult tDifficult = tArg.get <ScoreDifficult>("difficult");

        mHandler = MyBehaviour.create <ScoreHandler>();
        mHandler.load(tFileName, tDifficult);
        mHandler.show(new KeyTime(-3));
        mHandler.changeState(new ScoreHandler.PlayState(mHandler));
    }
Exemplo n.º 22
0
 // Start is called before the first frame update
 void Start()
 {
     sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>();
     if (flag == "drinkOffered" && sceneManager.drinkOffered == true)
     {
         sceneManager.SwitchScreen(nextIndex);
     }
     if (flag == "grabToy" && sceneManager.grabToy == true)
     {
         sceneManager.SwitchScreen(nextIndex);
     }
 }
Exemplo n.º 23
0
    public void back(float delay)
    {
        { StartCoroutine(sceneChange()); }

        IEnumerator sceneChange()
        {
            yield return(new WaitForSeconds(delay));

            // reload the current scene
            MySceneManager.LoadPreviousScene();
        }
    }
Exemplo n.º 24
0
    void Awake()
    {
        // Singleton Pattern
        if (instance == null)
        {
            instance      = this;
            instance.name = "Scene Man";
        }

        // Assign events
        UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
    }
Exemplo n.º 25
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 26
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            for (int i = 0; i < unlockStages.Length; ++i)
            {
                unlockStages[i] = true;
            }

            MySceneManager.changeScene(SceneNames.StageSelect);
        }
    }
Exemplo n.º 27
0
 public void SwitchMapResp(short state, SwitchMapRes down = null)
 {
     try
     {
         Debug.Log("切换地图: " + down.newMapId);
         if (state != 0)
         {
             StateManager.Instance.StateShow(state, 0);
             throw new Exception("state :" + state);
         }
         if (EntityWorld.Instance.EntSelf != null && EntityWorld.Instance.ActSelf)
         {
             EntityWorld.Instance.AddPosRecord(EntityWorld.Instance.EntSelf.ID, EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position(), -1);
         }
         EventDispatcher.Broadcast(SceneManagerEvent.ClearSceneDependentLogic);
         if (MySceneManager.IsCityWildScene(down.oldMapId) || MySceneManager.IsCityWildScene(down.newMapId))
         {
             down.selfObj.pos = null;
         }
         if (EntityWorld.Instance.EntSelf != null)
         {
             EntityWorld.Instance.EntSelf.SetDataByMapObjInfo(down.selfObj, false, down.transformId);
         }
         if (down.oldMapId != down.newMapId || (down.oldMapId == down.newMapId && MySceneManager.IsMainScene(down.newMapId)))
         {
             this.IsSceneExist  = false;
             this.lastSceneType = this.curSceneType;
             this.curSceneType  = ((!MySceneManager.IsMainScene(down.newMapId)) ? SceneType.Battle : SceneType.City);
             Loading.Instance.OnStartLoad(down.newMapId, down.otherObjs);
         }
         else
         {
             AOIService.Instance.SetMapArrivedObj(down.otherObjs);
         }
     }
     catch (Exception ex)
     {
         DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", string.Format("切换地图时出错 :{0} {3} {1} version: {2}", new object[]
         {
             DateTime.get_Now().ToString("yyyy/MM/dd HH:mm:ss"),
             down.newMapId,
             GameManager.Instance.GetLocalVersionsString(),
             state
         }), null, "确定", "button_orange_1", UINodesManager.T4RootOfSpecial);
         throw new MySceneManager.SwitchMapException(string.Concat(new object[]
         {
             "mapID:",
             down.newMapId,
             " state:",
             state
         }), ex);
     }
 }
Exemplo n.º 28
0
 void Awake()
 {
     if (ins == null)
     {
         ins = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
     else if (ins != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 29
0
    void Start()
    {
        if (instance != null)
        {
            DestroyImmediate(this.gameObject);
            return;
        }
        instance = this;

        DontDestroyOnLoad(gameObject);

        SceneManager.sceneLoaded += OnSceneLoaded; // 이벤트에 추가
    }
Exemplo n.º 30
0
 // Start is called before the first frame update
 void Start()
 {
     // Maintain the same instance across the game
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 31
0
	void Awake ()
    {
        _instance = this;

        //m_trialAmount = (SceneManager.sceneCountInBuildSettings - 4); // for automatic trial count for future expansion
	}