Exemple #1
0
    public override void DoUpdate()
    {
        bool canUse = CanRadar();

        hwmInput.Button skillInput = hwmSystem.GetInstance().GetInput().GetButton(m_ButtonIndex);

        if (m_IsRaderState)
        {
            if (canUse &&
                skillInput.GetState() != hwmInput.Button.State.Up)
            {
                m_Snake.CostPower(Time.deltaTime * MyProperties.CostPower);
            }
            else
            {
                slWorld.GetInstance().GetPlayerController().GetCamera().EnableRadarState(false, MyProperties.CameraSizeProperties);
                m_IsRaderState = false;
            }
        }
        else
        {
            m_InputButton.GetUIButton().interactable = canUse;

            skillInput.SetEnable(canUse);

            if (skillInput.GetState() == hwmInput.Button.State.Up)
            {
                slWorld.GetInstance().GetPlayerController().GetCamera().EnableRadarState(true, MyProperties.CameraSizeProperties);
                m_IsRaderState = true;
            }
        }
    }
Exemple #2
0
    public override void DoUpdate()
    {
        if (m_EnableSkill)
        {
            m_SkillRemainTime -= Time.deltaTime;
            if (m_SkillRemainTime < 0)
            {
                m_Snake.EnableRemainsFoodContamination(false, 0);
                m_EnableSkill = false;
                m_CD          = MyProperties.CD;
                CDText.color  = Color.white;
            }
            else
            {
                CDText.text = Mathf.CeilToInt(m_SkillRemainTime).ToString();
            }
        }
        else
        {
            m_CD -= Time.deltaTime;
            bool canUse = m_CD <= 0;
            m_InputButton.GetUIButton().interactable = canUse;
            hwmInput.Button skillInput = hwmSystem.GetInstance().GetInput().GetButton(m_ButtonIndex);
            skillInput.SetEnable(canUse);
            CDText.text = canUse || m_CD < 0
                                ? ""
                                : Mathf.CeilToInt(m_CD).ToString();

            if (skillInput.GetState() == hwmInput.Button.State.Up)
            {
                m_SkillRemainTime = MyProperties.Duration;
                m_InputButton.GetUIButton().interactable = false;
                skillInput.SetEnable(false);
                CDText.color  = Color.red;
                m_EnableSkill = true;
                m_Snake.EnableRemainsFoodContamination(true, MyProperties.Power);
            }
        }
    }
    public override void DoUpdate()
    {
        bool canUse = CanSpeedUp();

        m_InputButton.GetUIButton().interactable = canUse;

        hwmInput.Button skillInput = hwmSystem.GetInstance().GetInput().GetButton(m_ButtonIndex);
        skillInput.SetEnable(canUse);

        m_Snake.ChangeSpeedState(canUse && skillInput.IsPress()
                        ? slSnake.SpeedState.SpeedUp
                        : slSnake.SpeedState.Normal);
    }
    public override void DoUpdate()
    {
        m_CD -= Time.deltaTime;
        bool canUse = m_CD <= 0 && m_Snake.CanEatFood();

        m_InputButton.GetUIButton().interactable = canUse;
        hwmInput.Button skillInput = hwmSystem.GetInstance().GetInput().GetButton(m_ButtonIndex);
        skillInput.SetEnable(canUse);
        CDText.text = canUse || m_CD < 0
                        ? ""
                        : Mathf.CeilToInt(m_CD).ToString();

        if (skillInput.GetState() == hwmInput.Button.State.Up)
        {
            m_Snake.EatFood(MyProperties.Radius);
            m_CD = MyProperties.CD;
        }
    }