コード例 #1
0
    // Use this for initialization
    void Start()
    {
        string stateInfo = SteeringControls.instance().stateInfo();
        Text   outputTo  = GetComponent <Text>();

        if (outputTo == null)
        {
            outputTo = gameObject.AddComponent <Text>();
        }

        outputTo.text = stateInfo;
    }
コード例 #2
0
    void Awake()
    {
        if (!_isActive)
        {
            DontDestroyOnLoad(this.gameObject);
            _isActive = true;

            //init
            Steering = SteeringControls.instance();
            //Trackcapture  = sceneTrackdata.instance();
            //SceneChanger  = GetComponent<changeScene>();
            //unsign monobehaviors for more easy to bind gui events
            userProfile  = GetComponent <ProfileManager>();
            testSchema   = GetComponent <TestSchema>();
            menuUI       = GetComponent <MenuGui>();
            screensize   = new Rect();
            screensize.x = Screen.width;
            screensize.y = Screen.height;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }