void Awake() { instance = this; gameObject.GetComponent <AudioListener>().enabled = false; //Object.DontDestroyOnLoad(gameObject); }
// Use this for initialization void Awake() { myAnim = this.GetComponent <AnimatorControl>(); camAnim = Camera.main.GetComponent <Animator>(); myMovement = this.GetComponent <UnitMovement>(); tCam = this.GetComponentInChildren <ThirdCamera>(); myUnitState = this.GetComponent <UnitState>(); }
// Start is called before the first frame update void Start() { p = ScriptableObject.CreateInstance <Player>(); p.Init(); tc = ScriptableObject.CreateInstance <ThirdCamera>(); tc.target = p.GetTransform(); tc.Init(); p.myCam = Camera.main; }