// Start is called before the first frame update void Start() { if (Singleton == null) { Singleton = this; } if (Singleton != this) { Destroy(this); } player = Player.player; }
void Awake() { //makes it a singleton if (cameraTracking == null) { //DontDestroyOnLoad(gameObject); cameraTracking = this; } else if (cameraTracking != this) { Destroy(gameObject); } }
void Awake() { cameraTracking = FindObjectOfType <CameraTracking>(); magnitude = 0f; curMat = BlockMaterial.Wood; respawnTimerReset = respawnTimer; originalScale = this.transform.localScale; rgbdy = this.gameObject.GetComponent <Rigidbody>(); //state machine init machine = new PlayerStateMachine(); doState = new state[] { Idle, Moving, InAir, Jump, Attack, Hit, Dead }; invunTimer = 0; }
public CameraInputController() { canvas = Resources.FindObjectsOfTypeAll <Canvas>().First(x => x.name == "CameraCanvas"); if (canvas == null) { Debug.Log("camera canvas is null"); } cameraTrackingScript = canvas.GetComponentInChildren <CameraTracking>(); cameraTrackingScript.enabled = true; canvas.gameObject.SetActive(true); //canvas.enabled = true; if (cameraTrackingScript == null) { Debug.Log("cameraTracking is null"); } }
public void Awake() { colHandler = this.gameObject.GetComponent <Platform_CollisionHandler>(); inputController = this.gameObject.GetComponent <Platform_Input_Controller>(); this.rb = this.GetComponent <Rigidbody>(); this.myTrans = gameObject.transform; this.hp = this.lvl * this.baseHP; this.mp = this.lvl * this.baseMp; this.mhp = this.hp; this.mmp = this.mp; this.initPos = gameObject.transform.position; if (this.cam == null) { this.cam = Camera.main.GetComponent <CameraTracking>(); } }
void Awake() { cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraTracking> (); }
void Awake() { anims = GetComponentsInChildren <Animator> (); player = GameObject.FindGameObjectWithTag("Player"); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraTracking> (); }