コード例 #1
0
    public void Destruction()
    {
        float       scaleBy  = 1.0f;
        PlayerDrive pdScript = GetComponent <PlayerDrive>();

        if (pdScript)
        {
            scaleBy = pdScript.shipScale;
        }
        EnemyDrive edScript = GetComponent <EnemyDrive>();

        if (edScript)
        {
            scaleBy = edScript.shipScale;
        }

        GameObject effectGO = GameObject.Instantiate(deathEffectGO, transform.position, Quaternion.identity);

        effectGO.transform.localScale *= scaleBy;
        if (GetComponentInChildren <Camera>() != null)
        {
            Camera.main.transform.SetParent(null);
        }
        Destroy(gameObject);
    }
コード例 #2
0
ファイル: PlayerDrive.cs プロジェクト: teemak/wc-derby
    //private uint turnLeftID;
    //private uint turnRightID;

    protected override void Init()
    {
        instance = this;
        if (useCarCollisionTuning)
        {
            Vector3 camPosHigher = Camera.main.transform.localPosition;
            camPosHigher.y *= 1.3f;
            Camera.main.transform.localPosition = camPosHigher;

            UpdateLockIndicator uliScript = GetComponentInChildren <UpdateLockIndicator>();
            uliScript.TurnOff();
        }
        camStartVect = Camera.main.transform.position - bodyToTilt.transform.position;

        //turnLeftID = AkSoundEngine.GetIDFromString("Play_PlayerEngineTurnLeft");
        //turnRightID = AkSoundEngine.GetIDFromString("Play_PlayerEngineTurnRight");
    }