Esempio n. 1
0
    float counter;                  //计数器

    public static MoveMonsterAction GetSSAction(float speed)
    {
        MoveMonsterAction action = ScriptableObject.CreateInstance <MoveMonsterAction>();

        action.speed = speed;
        return(action);
    }
Esempio n. 2
0
    //巡逻
    public void MoveMonster(GameObject monster, float speed)
    {
        MonsterManager monsterManager = monster.GetComponent <MonsterManager>();

        if (monsterManager == null)
        {
            return;
        }
        if (!monsterManager.moveable)
        {
            monsterManager.moveable = true;
            monsterAction           = MoveMonsterAction.GetSSAction(speed);
            RunAction(monster, monsterAction, this);
        }
    }