Пример #1
0
    void Awake()
    {
        UIMainScript mainUIScript = (UIMainScript)FindObjectOfType(typeof(UIMainScript));

        if (mainUIScript != null)
        {
            GetComponent <UIPanel>().enabled = false;
        }
    }
Пример #2
0
    public void loadLevel(string levelName)
    {
        Destroy(this.gameObject);
        UIMainScript main = (UIMainScript)FindObjectOfType(typeof(UIMainScript));

        if (main != null)
        {
            Destroy(main.gameObject);
        }
        Application.LoadLevel(levelName);
    }
Пример #3
0
    /******************************************************
    * MonoBehaviour methods, Awake
    ******************************************************/

    void Awake()
    {
        if (players == null)
        {
            players = new PlayerScript[8];
        }

        players[playerId] = this;

        this.myTransform = transform;
        this.myRigidbody = rigidbody;

        playerPosition = GetComponent <PlayerPositionScript>();
        controls       = GetComponent <PlayerControls>();
        follower       = GetComponent <PathFollowScript>();


        UIMainScript mainUIScript = (UIMainScript)FindObjectOfType(typeof(UIMainScript));

        if (mainUIScript != null)
        {
            follower.isMoving = true;
            IsHuman           = false;
        }

        // register all the multiplier components within this gameobject
        Component[] multiplierComponents = GetComponentsInChildren(typeof(IAccelMultiplier));
        accelMultipliers = new IAccelMultiplier[multiplierComponents.Length];
        for (int i = 0; i < multiplierComponents.Length; i++)
        {
            accelMultipliers[i] = (IAccelMultiplier)multiplierComponents[i];
        }

        motionListeners = new List <IPlayerMotionListener>();
        statListeners   = new List <IStatListener>();

        IsHuman = isHuman;
    }