Example #1
0
 public bool ActivateSkill(float power, Hero hero, SHeroAnimator heroAnimator)
 {
     if (power >= SkillValue)
     {
         GameManager.IsSkillActive = IsSkillActive = true;
         GameManager.Instance.UpdateSkillValue(power - SkillValue);
         SkillStart();
         return(true);
     }
     return(false);
 }
Example #2
0
        public bool ActivateSkill(float power, Hero hero, SHeroAnimator heroAnimator)
        {
            MyHero       = hero;
            HeroAnimator = heroAnimator;

            if (power >= SkillValue)
            {
                GameManager.IsSkillActive = IsSkillActive = true;
                _power      = power;
                _timeToWait = SkillTime / SkillValue;
                _timeToEnd  = Time.time + SkillTime;
                SkillStart();
                StartCoroutine(SkillControlling());
                return(true);
            }
            return(false);
        }
        public void OnDrawGizmos()
        {
            if (Bake)
            {
                if (StateOfHero != null && StateOfHero.IsReady())
                {
                    SHeroAnimator sa = gameObject.AddComponent <SHeroAnimator>();
                    sa.AnimationAddresses = new AnimationAddress[7];
                    CLLContainer container = SerializationUtilits.SerialazingAnimation(StateOfHero.RunSprites);
                    sa.AnimationAddresses[0] = new AnimationAddress("Run", container, true);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.JumpUpSprites);
                    sa.AnimationAddresses[1] = new AnimationAddress("JumpUp", container, false);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.JumpDownSprites);
                    sa.AnimationAddresses[2] = new AnimationAddress("JumpDown", container, false);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.JumpSprites);
                    sa.AnimationAddresses[3] = new AnimationAddress("Jump", container, true);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.SlideUpSprites);
                    sa.AnimationAddresses[4] = new AnimationAddress("SlideUp", container, false);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.SlideDownSprites);
                    sa.AnimationAddresses[5] = new AnimationAddress("SlideDown", container, false);

                    container = SerializationUtilits.SerialazingAnimation(StateOfHero.SlideSprites);
                    sa.AnimationAddresses[6] = new AnimationAddress("Slide", container, true);

                    sa.DeffaultAnimation = "Run";

                    Bake = false;
                    if (DestoryIteself)
                    {
                        DestroyImmediate(this);
                    }
                }
                else
                {
                    Bake = false;
                    throw new ArgumentException("YOu have some problem with state", "StateOfHero");
                }
            }
        }
Example #4
0
 public bool ActivateSkill(float power, Hero hero, SHeroAnimator heroAnimator)
 {
     Debug.Log("We ActivateSkill");
     return(false);
 }