コード例 #1
0
ファイル: PlayerMovement.cs プロジェクト: Kyvi/8INF830
    // Use this for initialization
    void Start()
    {
        warpTime = warpSound.length + 0.5f;
        FindObjectOfType <QuestProgress>().StartTimer();
        engineAnimation = GetComponentInChildren <EnginesAnimation>();
        rb             = GetComponent <Rigidbody>();
        stats          = GameObject.Find("Stats").GetComponent <ShipStats>();
        player         = GetComponent <Player>();
        Cursor.visible = showCursor;
        //drag = rb.drag;

        UpdateSpeedAndAcceleration();

        if (warpGauge == null)
        {
            warpGauge = GameObject.Find("WarpGauge");
        }

        if (warpGauge != null)
        {
            warpSlider = warpGauge.GetComponentInChildren <Slider>();
            if (warpSlider == null)
            {
                Debug.LogError("Couldn't find warp slider");
            }
        }

        noise1.Play();
    }
コード例 #2
0
ファイル: PlayerMovement.cs プロジェクト: DeadPoolP/8INF830
    // Use this for initialization
    void Start()
    {
        engineAnimation = GetComponentInChildren <EnginesAnimation>();
        rb             = GetComponent <Rigidbody>();
        stats          = GameObject.Find("Stats").GetComponent <ShipStats>();
        player         = GetComponent <Player>();
        Cursor.visible = showCursor;
        //drag = rb.drag;

        UpdateSpeedAndAcceleration();

        if (warpGauge == null)
        {
            warpGauge = GameObject.Find("WarpGauge");
        }

        if (warpGauge != null)
        {
            warpSlider = warpGauge.GetComponentInChildren <Slider>();
            if (warpSlider == null)
            {
                Debug.Log("Couldn't find warp slider");
            }
            else
            {
                Debug.Log("warpGauge gameObject empty");
            }
        }
    }