Пример #1
0
    public static void ExecuteActionNPC(ModelNPC.PersonData dataNPC, NameActionsPerson p_nameAction, GameActionPersonController controller, bool isForce = false)
    {
        if (isForce && controller != null)
        {
            controller.ResetAction();
        }

        if (controller != null)
        {
            controller.ActionPerson = p_nameAction;
        }

        dataNPC.CurrentAction = p_nameAction.ToString();
    }
Пример #2
0
    public static void StartActionNPC(ModelNPC.PersonData dataNPC, NameActionsPerson p_nameAction, GameActionPersonController controller)
    {
        if (p_nameAction != NameActionsPerson.None)
        {
            if (controller != null)
            {
                controller.SetAction(p_nameAction);
            }
        }

        if (controller != null)
        {
            dataNPC.CurrentAction = controller.ActionPerson.ToString();
        }
        else
        {
            dataNPC.CurrentAction = p_nameAction.ToString();
        }

        switch (p_nameAction)
        {
        case NameActionsPerson.Idle:
            ActionIdle(dataNPC, controller);
            break;

        case NameActionsPerson.IdleLock:
            ActionIdleLock(dataNPC, controller);
            break;

        case NameActionsPerson.Move:
            if (controller == null)
            {
                ActionMove(dataNPC);
            }
            break;

        case NameActionsPerson.Completed:
            ActionTarget(dataNPC, controller);
            break;

        case NameActionsPerson.Dead:
            break;

        case NameActionsPerson.Attack:
            break;

        case NameActionsPerson.Work:
            ActionWork(dataNPC, controller);
            break;

        case NameActionsPerson.Target:
            ActionTarget(dataNPC, controller);
            break;

        case NameActionsPerson.TargetLocal:
            ActionTargetLocal(dataNPC, controller);
            break;

        case NameActionsPerson.TargetBackToBase:
            ActionTargetBackToBase(dataNPC, controller);
            break;
        }

        //Debug
        if (controller == null || Storage.SceneDebug.SettingsScene.RealDebugOn || Storage.SceneDebug.VipID == dataNPC.Id)
        {
            Storage.SceneDebug.ViewPerson(dataNPC, p_nameAction);
        }
    }