示例#1
0
 void Dash()
 {
     state = ElementalState.Dash;
     trailDropTimer.Start();
     forward = Vector2.one.Rotate(Random.Range(0, 8) * 45);
     myAnimator.SetInteger("Direction", (int)DirectionHandler.GetClosestDirection(forward));
 }
        private void SetElementEffect(ElementalState elementalState, ParticleSystem elementalEffect)
        {
            ballState.ElementalState = elementalState;
            elementalEffect.Play();

            effectTimeLeft = elementEffectTime;
        }
示例#3
0
    void SwitchState()
    {
        trailDropTimer.Stop();
        fireTimer.Stop();
        if (Random.value < 0.5f)
        {
            FacePlayer();
            Dash();
        }
        else
        {
            FacePlayer();
            state = ElementalState.Fire;
            fireTimer.Start();
        }

        /*
         * int nextState = Random.Range(0, 2);
         * switch(state)
         * {
         *  case ElementalState.Static:
         *      if (nextState == 0)
         *      {
         *          state = ElementalState.Dash;
         *      } else
         *      {
         *          state = ElementalState.Fire;
         *      }
         *      break;
         *  case ElementalState.Dash:
         *      if (nextState == 0)
         *      {
         *          state = ElementalState.Static;
         *      }
         *      else
         *      {
         *          state = ElementalState.Fire;
         *      }
         *      break;
         *  case ElementalState.Fire:
         *      if (nextState == 0)
         *      {
         *
         *      }
         *      else
         *      {
         *          state = ElementalState.Static;
         *      }
         *      break;
         * }
         */
    }
示例#4
0
    public void SwitchElementalState(ElementalState state)
    {
        meshRend = BossBody.GetComponent <SkinnedMeshRenderer>();
        switch (state)
        {
        case ElementalState.Fire:
        {
            firePic          = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFlame").GetComponent <Image>();
            phantPic         = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossPhant").GetComponent <Image>();
            icePic           = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFrost").GetComponent <Image>();
            firePic.enabled  = true;
            phantPic.enabled = false;
            icePic.enabled   = false;
            flameState       = true;
            phantState       = false;
            if (health < orgHealth / 2)
            {
                FlameShield.SetActive(true);
                ShadowShield.SetActive(false);
                FrostShield.SetActive(false);
            }
            meshRend.material = elementMaterial[0];
            bossOrgColor      = meshRend.material.color;
            glow.color        = new Color(255, 69, 0, 255);
            break;
        }

        case ElementalState.Thunder:
        {
            firePic          = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFlame").GetComponent <Image>();
            phantPic         = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossPhant").GetComponent <Image>();
            icePic           = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFrost").GetComponent <Image>();
            firePic.enabled  = false;
            phantPic.enabled = true;
            icePic.enabled   = false;
            flameState       = false;
            phantState       = true;
            frostState       = false;
            if (health < orgHealth / 2)
            {
                FlameShield.SetActive(false);
                ShadowShield.SetActive(true);
                FrostShield.SetActive(false);
            }
            meshRend.material = elementMaterial[1];
            bossOrgColor      = meshRend.material.color;
            glow.color        = new Color(72, 255, 0, 255);
            break;
        }

        case ElementalState.Ice:
        {
            firePic          = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFlame").GetComponent <Image>();
            phantPic         = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossPhant").GetComponent <Image>();
            icePic           = GameObject.Find("GameControl/Player/InGameCanvas/BossBanner/FaceMask/FinalBossFrost").GetComponent <Image>();
            firePic.enabled  = false;
            phantPic.enabled = false;
            icePic.enabled   = true;
            flameState       = false;
            phantState       = false;
            frostState       = true;
            if (health < orgHealth / 2)
            {
                FlameShield.SetActive(false);
                ShadowShield.SetActive(false);
                FrostShield.SetActive(true);
            }
            meshRend.material = elementMaterial[2];
            bossOrgColor      = meshRend.material.color;
            glow.color        = new Color(0, 132, 255, 255);
            break;
        }
        }
    }