protected override void HandleSetControllerSnake() { Vector3 cameraPosition = m_Camera.transform.localPosition; Vector3 snakeHaedPosition = m_Snake.GetHeadPosition(); cameraPosition.x = snakeHaedPosition.x; cameraPosition.y = snakeHaedPosition.y; m_Camera.transform.localPosition = cameraPosition; m_Input.JoystickCursor.SetAvailable(false); m_Input.GetAxis(hwmConstants.AxisIndex.MoveX).SetEnable(true); m_Input.GetAxis(hwmConstants.AxisIndex.MoveY).SetEnable(true); m_Input.GetButton(hwmConstants.ButtonIndex.Skill1).SetEnable(true); m_Input.GetButton(hwmConstants.ButtonIndex.Skill2).SetEnable(true); m_HUD.OnSetControllerSnake(); m_Skills = new slSkill[m_UsedSkill.Length]; for (int iSkill = 0; iSkill < m_Skills.Length; iSkill++) { slSkill.SkillType skillType = m_UsedSkill[iSkill]; m_Skills[iSkill] = m_HUD.PopSkill(skillType, iSkill); m_Skills[iSkill].Active(m_Snake, slConstants.SKILL_BUTTONINDEXS[iSkill]); } }
public slSkill PopSkill(slSkill.SkillType skillType, int anchors) { hwmDebug.Assert(anchors >= 0 && anchors < SkillAnchors.Length, "anchors >= 0 && anchors < SkillAnchors.Length"); slSkill skill = m_AllSkill[(int)skillType]; hwmDebug.Assert(!m_UsedSkills.Contains(skill), "!m_UsedSkills.Contains(skill)"); m_UsedSkills[anchors] = skill; skill.transform.SetParent(SkillAnchors[anchors], false); skill.transform.localPosition = Vector3.zero; return(skill); }