//NOTE: we call the correct anims for diff chars by using the same naming conventions for each char's animations. this way, we can just fill in the char's name to retrieve a particular animation for a particular character! // Use this for initialization void Start() { anim = GetComponent <Animator>(); //tell unity to seek the animator attached to the player obj. motor = GetComponent <PlayerMotor>(); //tell unity to seek the playermotor controller = GetComponent <PlayerController>(); //tell unity to seek the player controller stamina = FindObjectOfType <StaminaManager>(); }
private void Start() { var gameController = GameObject.FindWithTag("GameController"); inventory = gameController.GetComponent <InventoryManager>(); stamina = gameController.GetComponent <StaminaManager>(); }
void Start() { var gameController = GameObject.FindWithTag("GameController"); inventory = gameController.GetComponentInChildren <InventoryManager>(); score = gameController.GetComponentInChildren <ScoreManager>(); stamina = gameController.GetComponentInChildren <StaminaManager>(); }
private void Start() { mover = GetComponent <PlayerMover>(); var gameController = GameObject.FindWithTag("GameController"); inventory = gameController.GetComponentInChildren <InventoryManager>(); stamina = gameController.GetComponentInChildren <StaminaManager>(); }
public override void OnStartLocalPlayer() { GameObject.Find("NetworkManager").GetComponent <GameState>().GameMode = Constants.GameMode.match; GetComponent <MeshRenderer>().material.color = Color.cyan; //StaminaText = transform.parent.gameObject.GetComponent<Canvas>().GetComponent<Text>(); _staminaManager = GetComponent <StaminaManager>(); _spawnLocations = FindObjectsOfType <NetworkStartPosition>(); }
private void SetComponents() { FindComponents(); rb = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); staminaManager = gameObject.GetComponent <StaminaManager>(); staminaManager.Init(moveSpeed); if (gameObject.GetComponent <PlayerAnimator>() == null) { gameObject.AddComponent <PlayerAnimator>(); } else { playerAnimator = gameObject.GetComponent <PlayerAnimator>(); } playerAnimator.Init(animator); }
private void Start() { stamina = GameObject.FindWithTag("GameController").GetComponentInChildren <StaminaManager>(); }
private void Awake() { _PC = GetComponent <PlayerController>(); _IM = GetComponent <InputManager>(); _SM = GetComponent <StaminaManager>(); }
// Use this for initialization void Start() { mySM = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>(); myStaminaManager = GameObject.FindGameObjectWithTag("StaminaManager").GetComponent <StaminaManager>(); }