void Update() { if (GameState.state != GameState.PLAYING) { return; } if (Input.GetKeyDown(KeyCode.Keypad4) || Input.GetKeyDown(KeyCode.Alpha4)) { if (mentality.enough(mentalityCost)) { soundEffectManager.playBloodHitSound(); mentality.use(mentalityCost); float baseY = maze.getBaseY(maze.getFloor(transform.position.y)); Vector3 bloodPosition = new Vector3(2 * transform.forward.x + transform.position.x, baseY + 0.001f, 2 * transform.forward.z + transform.position.z); GameObject blood = Instantiate(bloodPrefab, bloodPosition, Quaternion.identity) as GameObject; blood.transform.localScale = new Vector3(maze.BLOCK_SIZE, 0.01f, maze.BLOCK_SIZE); blood.transform.eulerAngles = new Vector3(0, random.Next(360), 0); } else { // soundEffectManager.playErrorSound(); // MessageViewer.showErrorMessage("Not enough mentality"); } } string skillMessage = "Bloodletting"; skillMenu.setSkillMessage(4, skillMessage); }
void Start() { vitality = GetComponent <Vitality>(); mentality = GetComponent <Mentality>(); skillMenu = GameObject.FindWithTag("Main").GetComponent <SkillMenu>(); skillMenu.unlockSkill(1); skillMenu.setSkillMessage(1, "Roar"); soundEffectManager = GameObject.FindWithTag("Main").GetComponent <SoundEffectManager>(); }
//private SoundEffectManager soundEffectManager; void Start() { vitality = GetComponent <Vitality>(); isInvisible = false; skillMenu = GameObject.FindWithTag("Main").GetComponent <SkillMenu>(); skillMenu.unlockSkill(2); skillMenu.setSkillMessage(2, "Invisible"); //soundEffectManager = GameObject.FindWithTag("Main").GetComponent<SoundEffectManager>(); }
void Start() { vitality = GetComponent <Vitality>(); maze = GameObject.FindWithTag("Main").GetComponent <MazeGenerator>(); player = GameObject.FindWithTag("Player"); R = maze.MAZE_R; C = maze.MAZE_C; skillMenu = GameObject.FindWithTag("Main").GetComponent <SkillMenu>(); skillMenu.unlockSkill(3); skillMenu.setSkillMessage(3, "Eye"); soundEffectManager = GameObject.FindWithTag("Main").GetComponent <SoundEffectManager>(); }
void Start() { characterMotor = GetComponent <CharacterMotor>(); vitality = GetComponent <Vitality>(); footstep = GetComponentInChildren <Footstep>(); skillMenu = GameObject.FindWithTag("Main").GetComponent <SkillMenu>(); skillMenu.unlockSkill(0); skillMenu.setSkillMessage(0, "Sprint"); soundEffectManager = GameObject.FindWithTag("Main").GetComponent <SoundEffectManager>(); sprintForwardSpeed = originalForwardSpeed * timesOfSpeed; sprintSidewaysSpeed = originalSidewaysSpeed * timesOfSpeed; sprintBackwardsSpeed = originalBackwardsSpeed * timesOfSpeed; }