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); }
//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"); }