/** * Called before first frame update and used to instantiate our variables. */ void Start() { _anim = this.GetComponentInChildren <Animator>(); player = this.GetComponent <PlayerController>(); slashSpawner = this.GetComponent <SwordSlashSpawner>(); dm = this.GetComponent <DamageManager>(); _cs = player._cShaker; }
/** * Sets the active sword. */ public void EquipSword() { ind = PlayerPrefs.GetInt("equipped-sword", 0); for (int i = 0; i < swords.Count; i++) { if (i == ind) { swords[i].transform.gameObject.SetActive(true); } else { swords[i].transform.gameObject.SetActive(false); } } slashSpawner = this.GetComponent <SwordSlashSpawner>(); slashSpawner.SetSlash(); }