コード例 #1
0
    void startPos()
    {
        if (LoadingScript.Instance.loading)
        {
            return;
        }
        if (!isLocalPlayer)
        {
            return;
        }
        GenerateDungeon temp = GameObject.Find("DungeonGen").GetComponent <GenerateDungeon>();

        switch (Random.Range(0, 4))
        {
        case 0:
            transform.position = temp.spawnLocal.transform.position;
            break;

        case 1:
            transform.position = temp.spawnLocal1.transform.position;
            break;

        case 2:
            transform.position = temp.spawnLocal2.transform.position;
            break;

        case 3:
            transform.position = temp.spawnLocal3.transform.position;
            break;
        }
        CancelInvoke();
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        GenerateDungeon script = (GenerateDungeon)target;

        if (GUILayout.Button("Generate Dungeon"))
        {
            script.GenerateNewDungeon();
        }
    }
コード例 #3
0
 void Awake()
 {
     Instance = this;
 }
コード例 #4
0
ファイル: GenerateDungeon.cs プロジェクト: jdgbas/he
 private void Awake()
 {
     Instance = this;
     objects  = new List <GameObject>();
 }