示例#1
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        Owner.SensorsComponent.AddSensor(E_SensorType.CoverPlayer, true);
        Owner.SensorsComponent.AddSensor(E_SensorType.EyePlayer, true);

        Owner.AddGOAPAction(E_GOAPAction.Goto);
        Owner.AddGOAPAction(E_GOAPAction.Move);
        Owner.AddGOAPAction(E_GOAPAction.CoverEnter);
        Owner.AddGOAPAction(E_GOAPAction.CoverMove);
        Owner.AddGOAPAction(E_GOAPAction.CoverLeave);
        Owner.AddGOAPAction(E_GOAPAction.CoverFire);
        Owner.AddGOAPAction(E_GOAPAction.CoverJumpOverPlayer);
        Owner.AddGOAPAction(E_GOAPAction.CoverLeaveRightLeft);
        Owner.AddGOAPAction(E_GOAPAction.Use);
        Owner.AddGOAPAction(E_GOAPAction.WeaponReload);
//		Owner.AddGOAPAction(E_GOAPAction.WeaponChange);
        Owner.AddGOAPAction(E_GOAPAction.Roll);
        Owner.AddGOAPAction(E_GOAPAction.UseGadget);
        Owner.AddGOAPAction(E_GOAPAction.Melee);

        Owner.AddGOAPGoal(E_GOAPGoals.Move);
        Owner.AddGOAPGoal(E_GOAPGoals.CoverEnter);
        Owner.AddGOAPGoal(E_GOAPGoals.CoverLeave);
        Owner.AddGOAPGoal(E_GOAPGoals.CoverFire);
        Owner.AddGOAPGoal(E_GOAPGoals.CoverMove);
        Owner.AddGOAPGoal(E_GOAPGoals.UseWorldObject);
        Owner.AddGOAPGoal(E_GOAPGoals.WeaponReload);
//		Owner.AddGOAPGoal(E_GOAPGoals.WeaponChange);
        Owner.AddGOAPGoal(E_GOAPGoals.Roll);
        Owner.AddGOAPGoal(E_GOAPGoals.UseGadget);
        Owner.AddGOAPGoal(E_GOAPGoals.Melee);

        Owner.InitializeGOAP();

        //register controls delegates
        Controls.FireDownDelegate     = ActionBeginFire;
        Controls.FireUpDelegate       = ActionEndFire;
        Controls.UseDelegate          = ActionUse;
        Controls.UseObjectDelegate    = ActionUseObject;
        Controls.ReloadDelegate       = ActionReload;
        Controls.RollDelegate         = ActionRoll;
        Controls.SprintDownDelegate   = ActionSprintBegin;
        Controls.SprintUpDelegate     = ActionSprintEnd;
        Controls.ChangeWeaponDelegate = ActionChangeWeapon;
        Controls.UseGadgetDelegate    = ActionUseGadget;
        Controls.SendCommandDelegate  = ActionCommand;
    }