private void Start() { playerRigidbody = GetComponent <Rigidbody>(); gameManager = FindObjectOfType <OldGameManager>(); uiTexts = FindObjectOfType <OldUITexts>(); hasKilledTextCurrentTime = hasKilledTextTime; hasBeenKilledTextCurrentTime = hasBeenKilledTextTime; gameManager.myPlayerController = this; }
private void CheckSingeltonInstance() { if (Instance != null) { Destroy(gameObject); } Instance = this; DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { GameManagerScript = GameManagerObject.GetComponent <OldGameManager>(); playerTransform = GetComponent <Transform>(); cameraTransform = CameraObject.GetComponent <Transform>(); playerRigidBody = GetComponent <Rigidbody>(); playerCollider = GetComponent <CapsuleCollider>(); yaw = playerTransform.eulerAngles.y; pitch = playerTransform.eulerAngles.x; }
void Awake() { if (inst == null) { inst = this; } else if (inst != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); if (isTesting) { return; } }