public override void SetUpEntityComponent(GameEntity entity)
    {
        base.SetUpEntityComponent(entity);
        myTransform = entity.transform;
        sensing     = (entity as Fishie).sensing;
        actions     = (entity as Fishie).actions;
        ressources  = (entity as Fishie).ressources;

        currentWanderDestination = Vector2.zero;
    }
    protected override void Start()
    {
        sensing          = GetComponent <EC_Sensing>();
        movement         = GetComponent <EC_Movement>();
        playerController = GetComponent <EC_PlayerController>();
        fishieAI         = GetComponent <EC_FishieAI>();
        ressources       = GetComponent <EC_Ressources>();
        actions          = GetComponent <EC_Actions>();

        //setup all attached components
        if (playerController != null)
        {
            components = new GameEntityComponent[] { sensing, movement, actions, ressources, playerController }
        }
        ;
        else if (fishieAI != null)
        {
            components = new GameEntityComponent[] { sensing, movement, actions, ressources, fishieAI }
        }
        ;

        base.Start();
    }
}
Exemplo n.º 3
0
 public override void SetUpEntityComponent(GameEntity entity)
 {
     base.SetUpEntityComponent(entity);
     ressources = (entity as Fishie).ressources;
     movement   = (entity as Fishie).movement;
 }