コード例 #1
0
    // Use this for initialization
    void Start()
    {

        if (windowToShowOrHide.activeInHierarchy)
        {
            isOpen = true;
        }

        //you have to have the intro screen on b/c it holds the reference to toggle the character controller
        if (GameObject.Find("CharacterControllerObject") != null)
        {
            if (GameObject.Find("CharacterControllerObject").activeInHierarchy)
            {
                tcc = GameObject.Find("CharacterControllerObject").GetComponentInChildren<BNG_ToggleCharacterController>(); //there can only be one! of these references
                tcc.setupCC();

                //if the intro screen is not null, and is hidden, don't disable the character controller
                if (GameObject.Find("Intro Screen") != null)
                {
                    if (GameObject.Find("Intro Screen").transform.gameObject.activeInHierarchy) tcc.disablePlayer();
                }
            }
        }

    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        if (windowToShowOrHide.activeInHierarchy)
        {
            isOpen = true;
        }

        //you have to have the intro screen on b/c it holds the reference to toggle the character controller
        if (GameObject.Find("CharacterControllerObject") != null)
        {
            if (GameObject.Find("CharacterControllerObject").activeInHierarchy)
            {
                tcc = GameObject.Find("CharacterControllerObject").GetComponentInChildren <BNG_ToggleCharacterController>(); //there can only be one! of these references
                tcc.setupCC();

                //if the intro screen is not null, and is hidden, don't disable the character controller
                if (GameObject.Find("Intro Screen") != null)
                {
                    if (GameObject.Find("Intro Screen").transform.gameObject.activeInHierarchy)
                    {
                        tcc.disablePlayer();
                    }
                }
            }
        }
    }