Update() public method

public Update ( ) : void
return void
Ejemplo n.º 1
0
    public override bool ObjUpdate()
    {
        if (IsDie())
        {
            return(false);
        }
        base.ObjUpdate();
        if (actionManager != null)
        {
            actionManager.Update();
        }

        if (ai != null)
        {
            ai.Update();
        }

        //生命回复
        if (life < propertys.GetProperty(enCharacterProperty.life))
        {
            lifeReviveTime += Time.deltaTime;
            if (lifeReviveTime >= 1)
            {
                lifeReviveTime  -= 1;
                lifeReviveCount += propertys.GetProperty(enCharacterProperty.liferevive);

                if (lifeReviveCount >= 1)
                {
                    int addval = (int)lifeReviveCount;
                    this.ChangeLife(null, addval, false);
                    lifeReviveCount -= addval;
                }
            }
        }

        //魔法回复
        if (mana < propertys.GetProperty(enCharacterProperty.mana))
        {
            manaReviveTime += Time.deltaTime;
            if (manaReviveTime >= 1)
            {
                manaReviveTime  -= 1;
                manaReviveCount += propertys.GetProperty(enCharacterProperty.manarevive);

                if (manaReviveCount >= 1)
                {
                    int addval = (int)manaReviveCount;
                    this.ChangeMana(addval);
                    manaReviveCount -= addval;
                }
            }
        }

        this.SetZPos();
        return(true);
    }
Ejemplo n.º 2
0
 public override bool ObjUpdate()
 {
     base.ObjUpdate();
     if (IsDie())
     {
         return(false);
     }
     ai.Update();
     return(true);
 }