Example #1
0
    void makeStart()
    {
        if (theSkill != null)
        {
            return;
        }

        if (SystemValues.thePlayer != null)
        {
            if (findType == SkillFindType.component)
            {
                theSkill = (SkillBasic)SystemValues.thePlayer.GetComponentInChildren(System.Type.GetType(skillName));
            }
            else if (findType == SkillFindType.transform)
            {
                //print (skillName);
                Transform theChild = SystemValues.thePlayer.transform.Find("SkillPackage/" + skillName);
                //print (theChild.gameObject.name);
                theSkill = theChild.GetComponent <SkillBasic> ();
            }
        }
        if (theSkill != null)
        {
            theSkill.theButton      = this;
            theButton.normalSprite  = theSkill.theSkillSprite;
            theButton.pressedSprite = theSkill.theSkillSprite;
            theButton.pressedColor  = Color.gray;
        }
    }
Example #2
0
 /// <summary>
 /// 这个方法食欲带动作的技能触发事件联系在一起的
 /// 这个方法是自动Animator调用的
 /// </summary>
 public void SkillEffect(float extradamage)
 {
     if (theSkillNow != null)
     {
         theSkillNow.SkillEffect(extradamage);
     }
     theSkillNow = null;
 }