Beispiel #1
0
    private FeiPanManager mFeiPanManager; // 飞盘管理组件

    void Start()
    {
        mStartUI = GameObject.Find("StartUI");
        mGameUI  = GameObject.Find("GameUI");
        mEndUI   = GameObject.Find("EndUI");

        // 游戏分数文本组件
        mGameScoreText = GameObject.Find("GameScore").GetComponent <GUIText>();

        // 剩余游戏时间文本组件
        mGameTimeText = GameObject.Find("GameTime").GetComponent <GUIText>();

        // 游戏总共得分文本组件
        mGameTotalScore = GameObject.Find("GameTotalScore").GetComponent <GUIText>();

        // 背景声音组件
        mBgAudioScoure = GameObject.Find("Main Camera").GetComponent <AudioSource>();

        // 武器脚本组件
        mWeapon = GameObject.Find("Weapon").GetComponent <Weapon>();

        // 飞盘管理组件
        mFeiPanManager = GameObject.Find("FeiPanParent").GetComponent <FeiPanManager>();

        // 游戏默认状态是开始状态
        ChangeGameState(GameState.START);
    }
Beispiel #2
0
    private GUIText TotalScoreText; //总得分文本框

    void Start()
    {
        m_StartUI      = GameObject.Find("StartUI");
        m_GameUI       = GameObject.Find("GameUI");
        m_EndUI        = GameObject.Find("EndUI");
        bgAudio        = GameObject.Find("Main Camera").GetComponent <AudioSource>();
        weapon         = GameObject.Find("Weapon").GetComponent <Weapon>();
        feipanManager  = GameObject.Find("FeiPanParent").GetComponent <FeiPanManager>();
        ScoreText      = GameObject.Find("Score").GetComponent <GUIText>();
        TimeText       = GameObject.Find("GameTime").GetComponent <GUIText>();
        TotalScoreText = GameObject.Find("TotalScore").GetComponent <GUIText>();

        ChangeGameState(GameState.START);
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        m_StartUI = GameObject.Find("StartUI");
        m_GameUI  = GameObject.Find("GameUI");
        m_EndUI   = GameObject.Find("EndUI");
        m_GUIText = GameObject.Find("GameScore").GetComponent <GUIText>();

        m_AudioSource   = GameObject.Find("Main Camera").GetComponent <AudioSource>();
        m_weapon        = GameObject.Find("Hand").GetComponent <Weapon>();
        m_FeiPanManager = GameObject.Find("FeiPanParent").GetComponent <FeiPanManager>();

        time_GUIText = GameObject.Find("GameTime").GetComponent <GUIText>();

        end_GUIText = GameObject.Find("GameTotalScore").GetComponent <GUIText>();
        ChangeGameStatus(GameStatus.START);
    }
Beispiel #4
0
    private int m_Score;                                // 分数

    void Start()
    {
        // 获取UI节点
        m_UiStart = GameObject.Find("StartUI");
        m_UiGame  = GameObject.Find("GameUI");
        m_UiEnd   = GameObject.Find("EndUI");

        // 获取游戏开始声音源
        m_AudioSourceStart = Camera.main.GetComponent <AudioSource>();

        // 获取武器脚本
        m_Weapon = GameObject.Find("Weapon").GetComponent <Weapon>();
        // 获取飞盘管理器脚本
        m_FeiPanManager = GameObject.Find("FeiPanManager").GetComponent <FeiPanManager>();

        // 设置游戏为开始状态
        ChangeGameState(GAME_STATE.START);
    }