public void NewSceneLoaded()
 {
     cameraZoom            = FindObjectOfType <ViewSwitch>();
     playerHistory         = FindObjectOfType <PlayerHistory>();
     playerMovement        = FindObjectOfType <PlayerMovement>();
     playerMovement.frozen = false;
 }
예제 #2
0
    private void DrawPool(GameObjectPool pool)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(StringUtil.Contact("ID:", pool.instanceId), GUILayout.MaxWidth(100));
        EditorGUILayout.ObjectField("Root", pool.root, typeof(GameObject), true, GUILayout.MaxWidth(300));
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();

        ViewSwitch viewSwitch = null;

        if (!this.switches.ContainsKey(pool.instanceId))
        {
            viewSwitch = this.switches[pool.instanceId] = new ViewSwitch(pool.instanceId);
        }
        else
        {
            viewSwitch = this.switches[pool.instanceId];
        }

        viewSwitch.active = EditorGUILayout.Toggle("使用的", viewSwitch.active);
        EditorGUILayout.EndHorizontal();

        if (viewSwitch.active)
        {
            var freeList = pool.GetActiveList();
            EditorGUI.indentLevel++;
            for (int i = 0; i < freeList.Count; i++)
            {
                var element = freeList[i];
                EditorGUILayout.ObjectField(StringUtil.Contact("Element", i + 1), element, typeof(GameObject), true);
            }
            EditorGUI.indentLevel--;
        }

        EditorGUILayout.BeginHorizontal();
        viewSwitch.free = EditorGUILayout.Toggle("备用的", viewSwitch.free);
        EditorGUILayout.EndHorizontal();

        if (viewSwitch.free)
        {
            var poolList = pool.GetFreeList();
            EditorGUI.indentLevel++;
            for (int i = 0; i < poolList.Count; i++)
            {
                var element = poolList[i];
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.ObjectField(StringUtil.Contact("Element", i + 1), element, typeof(GameObject), true);
                EditorGUILayout.LabelField(element == null || element.transform.parent != pool.root.transform ? "Error" : "");
                EditorGUILayout.EndHorizontal();
            }
            EditorGUI.indentLevel--;
        }
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        player         = FindObjectOfType <PlayerMovement>();
        playerHistory  = FindObjectOfType <PlayerHistory>();
        cameraSwitcher = FindObjectOfType <ViewSwitch>();
        dialogueBoxes  = GameObject.Find("UICanvas").transform.GetChild(2).gameObject;
        listen         = GameObject.Find("UICanvas").transform.GetChild(2).GetChild(1).gameObject;
        question       = GameObject.Find("UICanvas").transform.GetChild(2).GetChild(2).gameObject;
        text           = GameObject.Find("UICanvas").transform.GetChild(2).GetChild(0).gameObject;

        textManager = GameObject.Find("TextBoxManager").GetComponent <TextBoxManager>();
    }
    void Start()
    {
        cameraZoom     = FindObjectOfType <ViewSwitch>();
        playerHistory  = FindObjectOfType <PlayerHistory>();
        playerMovement = FindObjectOfType <PlayerMovement>();
        wordBank       = FindObjectOfType <WordBankManager>();
//        textBox = GameObject.Find("DialoguePanel");
        listenJsonParser   = FindObjectOfType <ListenJsonParser>();
        questionJsonParser = FindObjectOfType <QuestionJsonParser>();

        playerMovement.frozen = false;
        canvas       = GameObject.Find("UICanvas");
        listenJson   = listenJsonParser.parseLevelJson("levelOne");
        questionJson = questionJsonParser.parseLevelJson("levelOne");
    }