示例#1
0
        void Update()
        {
            if (debugMode || debugmodel2)
            {
                if (cc == null)
                {
                    World world = new World();
                    world.zero   = Vector3.zero;
                    world.bounds = new Bounds(new Vector3(0, 2, 0), new Vector3(100, 4, 100));
                    cd           = new GraphChar_Driver(0, transform, world, false);
                    //测试模式时直接调用AniPlayer
                    if (debugMode)
                    {
                        cc = new FightFSM(cd, null, stateTable, aiStateTable, stateTree, FBJoy2.g_joy);
                        cd.Update(Time.deltaTime);
                    }

                    else if (debugmodel2)
                    {
                        cc = new FightFSM(cd, null, stateTable, aiStateTable, stateTree, null);
                        cc.ChangeBlock("select", 0);
                    }
                }
                cc.Update();

                return;
            }

            if (Hp != lasthp)
            {
                SetHPBar(Hp);
            }
            timer += Time.deltaTime;
            if (timer >= 3 && hpBar != null)
            {
                //把alpha 改成0;隐藏
                var color = hpBar.GetComponent <MeshRenderer>().material.color;
                if (color.a <= 0f)
                {
                    return;
                }
                color.a -= Time.deltaTime;
                hpBar.GetComponent <MeshRenderer>().material.color = color;
            }
            if (dir != transform.GetComponent <AniPlayer>().dir)
            {
                dir = transform.GetComponent <AniPlayer>().dir;
                if (hpBar != null)
                {
                    if (dir == 1)
                    {
                        hpBar.rotation = Quaternion.Euler(-90, 180, 0);
                    }
                    else
                    {
                        hpBar.rotation = Quaternion.Euler(-90, -180, 0);
                    }
                }
            }
        }
示例#2
0
 public void CancelHold()
 {
     if (this.hold != null)
     {
         this.hold.EndFollow();
     }
     this.hold = null;
 }
示例#3
0
 public void SetHold(GraphChar_Driver hold)
 {
     if (this.hold != null)
     {
         return;
     }
     this.hold = hold;
     holdAdd   = Vector3.zero;
 }
        public LogicChar_Driver(IBattleField battleField, int id)
        {
            this.battleField = battleField as BattleField;
            this.id          = id;
            this.idHold      = -1;
            ap = (battleField as BattleField).GetRealChar(id);

            mapParam["hp"]    = 100;
            mapParam["hpmax"] = 500;
            mapParam["mp"]    = 5;
            mapParam["mpmax"] = 500;
        }