protected void Awake()
    {
        actor = GetComponent<GameObjectActor>();
        if(!actor) {
            Debug.LogError("Steering manager is not attached to an actor!");
        }
        manager = new SteeringManager();

        behaviors = new Dictionary<string, SteeringBehaviorProxy>();
        foreach(SteeringBehaviorAsset asset in steeringAssets) {
            SteeringBehaviorProxy proxy = new SteeringBehaviorProxy(asset);
            behaviors[asset.name] = proxy;
            foreach(SteeringBehavior behavior in proxy.behaviors) {
                manager.AddBehavior(behavior);
            }
        }
    }
Exemple #2
0
    protected void Awake()
    {
        actor = GetComponent <GameObjectActor>();
        if (!actor)
        {
            Debug.LogError("Steering manager is not attached to an actor!");
        }
        manager = new SteeringManager();

        behaviors = new Dictionary <string, SteeringBehaviorProxy>();
        foreach (SteeringBehaviorAsset asset in steeringAssets)
        {
            SteeringBehaviorProxy proxy = new SteeringBehaviorProxy(asset);
            behaviors[asset.name] = proxy;
            foreach (SteeringBehavior behavior in proxy.behaviors)
            {
                manager.AddBehavior(behavior);
            }
        }
    }