示例#1
0
    // Use this for initialization
    public virtual void Initialize(MacroAIParty party, Faction faction)
    {
        RunningNodeHist = new MaxStack <string>(20);

        AimSkill                     = UnityEngine.Random.Range(0.6f, 1f);
        MyShip                       = transform.GetComponent <ShipBase>();
        AvoidanceDetector            = MyShip.MyReference.AvoidanceDetector;
        AvoidanceDetector.ParentShip = MyShip;

        Whiteboard = new Whiteboard();
        Whiteboard.Initialize();

        //AttackTarget = GameManager.Inst.PlayerControl.PlayerShip;

        //Whiteboard.Parameters["TargetEnemy"] = AttackTarget;
        Whiteboard.Parameters["SpeedLimit"] = -1f;

        MyParty       = party;
        MyFaction     = faction;
        MyPartyNumber = MyParty.PartyNumber;

        WeaponControl = new AIWeaponControl();
        WeaponControl.Initialize(this);

        TreeSet = new Dictionary <string, BehaviorTree>();
        TreeSet.Add("BaseBehavior", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("BaseBehavior", this, party));
        TreeSet.Add("Travel", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("Travel", this, party));
        TreeSet.Add("FollowFriendly", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("FollowFriendly", this, party));
        TreeSet.Add("FighterCombat", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("FighterCombat", this, party));
        TreeSet.Add("BigShipCombat", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("BigShipCombat", this, party));
    }
示例#2
0
    public override void Initialize(MacroAIParty party, Faction faction)
    {
        RunningNodeHist = new MaxStack <string>(20);
        MyShip          = transform.GetComponent <ShipBase>();


        Whiteboard = new Whiteboard();
        Whiteboard.Initialize();

        //AttackTarget = GameManager.Inst.PlayerControl.PlayerShip;

        //Whiteboard.Parameters["TargetEnemy"] = AttackTarget;
        Whiteboard.Parameters["SpeedLimit"] = -1f;

        MyParty   = party;
        MyFaction = faction;

        TreeSet = new Dictionary <string, BehaviorTree>();
        TreeSet.Add("BaseBehavior", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("BaseBehavior", this, party));
        TreeSet.Add("APTravel", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("APTravel", this, party));
        TreeSet.Add("FollowFriendly", GameManager.Inst.DBManager.XMLParserBT.LoadBehaviorTree("FollowFriendly", this, party));
    }