コード例 #1
0
ファイル: DemoSelectUI.cs プロジェクト: cfox/seedQuest
    private void Start()
    {
        GameManager.ResetCursor();
        InteractableManager.Reset();
        InteractablePathManager.Reset();

        GameObject sideNav = GameObject.FindGameObjectWithTag("SideNav");

        for (int i = 0; i < demoList.Length; i++)
        {
            Vector3 position = buttonOffset + new Vector3(0, -i * buttonPadding, 0);
            demoList[i].select = createLevelButton(demoList[i], sideNav.transform, position);
        }

        demoList[0].select.onClick.Invoke();
    }
コード例 #2
0
ファイル: LevelSelect.cs プロジェクト: jaywgraves/seedQuest
    private void Start()
    {
        // Reset Cursor and Interactables
        GameManager.ResetCursor();
        InteractableManager.Reset();

        // Get LevelListCanvas
        levelsCanvas    = GameObject.FindGameObjectWithTag("LevelListCanvas");
        modeText        = GetComponentsInChildren <TextMeshProUGUI>()[2];
        levelButtonList = new List <Button>();

        // Destroy unnecessary gameobjects
        foreach (Transform child in levelsCanvas.transform)
        {
            GameObject.Destroy(child.gameObject);
        }


        // Create LevelButtons
        int i = 0;

        foreach (LevelInfo level in levelList)
        {
            Button button = createLevelButton(levelsCanvas.transform, new Vector3(0, -i * (height + padding), 0), new Vector2(512, 512), level.levelImage);
            levelButtonList.Add(button);
            i++;
        }
        SetValidLevelSelect();

        // Add Button Listeners to LevelButtons
        GameObject.FindGameObjectWithTag("NextButton").GetComponent <Button>().onClick.AddListener(nextLevel);
        GameObject.FindGameObjectWithTag("PrevButton").GetComponent <Button>().onClick.AddListener(prevLevel);

        // Setup Text and Background Color
        setBackgroundColor();
        setCurrentLevelText();
        setCurrentModeText();
    }
コード例 #3
0
ファイル: GameController.cs プロジェクト: chatrat12/Overdone
 public void Reset()
 {
     _playerOne.Player.Reset();
     _playerTwo.Player.Reset();
     InteractableManager.Reset();
 }