SteeringOutput steering; //steering del personaje public FaceToSeenTarget(SightSensor Sensor, Kinetics Character, SteeringOutput Steering) { face = new Face(Character, Character); sensor = Sensor; character = Character; steering = Steering; }
void Start() { //rival agentKinetics = agentStatic.kineticsAgent; //POKEMONS pokemons = GameObject.FindGameObjectsWithTag("Pokemon"); List <pokemon_data> pokemonDataList = new List <pokemon_data>(); for (int i = 0; i < pokemons.Length; i++) { pokemons_list.Add(pokemons[i].GetComponent <static_data>().kineticsAgent); pokemonDataList.Add(pokemons[i].GetComponent <pokemon_data>()); } pokemons_data = pokemonDataList.ToArray(); pokemons_kins = pokemons_list.ToArray(); //OBSTACLES GameObject[] obstaclesGo = GameObject.FindGameObjectsWithTag("Obstacle"); for (int i = 0; i < obstaclesGo.Length; i++) { obstacles_list.Add(obstaclesGo[i].GetComponent <Transform>()); } obstacles = obstacles_list.ToArray(); //SENSOR sightSensor = sensorComp.sensor; }
void Start() { //Inicializamos las estructuras necesarias steeringAgent = agent.steeringAgent; kineticsAgent = agent.kineticsAgent; }
// Start is called before the first frame update void Start() { kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; look = new LookWhereYouAreGoing(kineticsAgent); }
Vector3 characterPosition; //necesitaremos esto para ver si caimos en una esquina public ObstacleAvoidance(Kinetics Character, Transform[] Obstacles, float AvoidDistance, float LookAhead, SteeringOutput CharacterSteering) : base(Character, Character, 1f) { avoidDistance = AvoidDistance; lookAhead = LookAhead; collisionDetector = new CollisionDetector(Obstacles); characterSteering = CharacterSteering; }
public Separation(Kinetics Character, Kinetics[] Targets, float Threshold, float MaxAccel) { character = Character; targets = Targets; threshold = Threshold; maxAccel = MaxAccel; }
public CollisionAvoidance(Kinetics Character, float MaxAccel, Kinetics[] Targets, float Radius) { character = Character; maxAccel = MaxAccel; targets = Targets; radius = Radius; }
// Start is called before the first frame update void Start() { kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; follow = new FollowPath(kineticsAgent, maxSeekAccel, pathOffset); }
public VelocityMatch(Kinetics Character, Kinetics Target, float MaxAcceleration, float TimeToTarget) { character = Character; target = Target; maxAcceleration = MaxAcceleration; timeToTarget = TimeToTarget; }
public RunFromTargets(SteeringOutput SteeringAgent, Kinetics KineticsAgent, Kinetics[] KineticsTargets, float MaxAccel) { steeringAgent = SteeringAgent; kineticsAgent = KineticsAgent; kineticsTargets = KineticsTargets; seek = new Seek(kineticsAgent, kineticsTargets[0], MaxAccel); }
public UpdateAStarGameObject(Stack <GameObject> Items, PathFindAStar AStar, Graph Graph, Kinetics KinAgent, string[] Walkable) { items = Items; aStar = AStar; graph = Graph; kinAgent = KinAgent; walkable = Walkable; }
public UpdateAStar(Stack <Kinetics> Pokemons, PathFindAStar AStar, Graph Graph, Kinetics KinAgent, string[] Walkable) { pokemons = Pokemons; aStar = AStar; graph = Graph; kinAgent = KinAgent; walkable = Walkable; }
public void Start() { kball = ball.GetComponent <Kinetics> (); rball = ball.GetComponent <Renderer> (); ren = gameObject.GetComponent <Renderer> (); racketLastPosition = mop.GetObjectPosition(ren); }
public FollowPathOfPoints(SteeringOutput SteeringAgent, Seek Seek, Vector3[] Path, bool Underground) { steeringAgent = SteeringAgent; seek = Seek; agentKin = seek.character; path = Path; underground = Underground; }
public KinematicArrive(Kinetics Character, Kinetics Target, float Maxspeed, float Time, float Radius) { character = Character; target = Target; maxspeed = Maxspeed; timeToTarget = Time; radius = Radius; }
public FollowTarget(SteeringOutput SteeringAgent, Kinetics KineticsAgent, Kinetics KineticsTarget, float MaxAccel) { steeringAgent = SteeringAgent; kineticsAgent = KineticsAgent; kineticsTarget = KineticsTarget; seek = new Seek(kineticsAgent, kineticsTarget, MaxAccel); }
public ArrivedToPosition arrived;//condicion que tenemos que actualizar tambien public UpdateAStarRandom(PathFindAStar AStar, Graph Graph, Kinetics KinAgent, ArrivedToPosition Arrived, string[] Walkable) { aStar = AStar; graph = Graph; kinAgent = KinAgent; arrived = Arrived; walkable = Walkable; }
public UpdateAStarTarget(PathFindAStar AStar, Graph Graph, Kinetics KinAgent, Node Target, string[] Walkable) { aStar = AStar; graph = Graph; kinAgent = KinAgent; newTarget = Target; walkable = Walkable; }
public Wander(Kinetics Character, float WanderOffset, float WanderRadius, float WanderRate, float WanderOrientation, float MaxAccel) : base(Character, Character) { wanderOffset = WanderOffset; wanderRadius = WanderRadius; wanderRate = WanderRate; wanderOrientation = WanderOrientation; maxAccel = MaxAccel; }
void Start() { //Inicializamos las estructuras necesarias de otros componentes kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //iniciamos wandering kinWander = new KinematicWandering(kineticsAgent, 2f, 100f); }
public ArriveToTarget(SteeringOutput SteeringAgent, Kinetics KineticsAgent, Kinetics KineticsTarget, float MaxAccel, float MaxSpeed, float TargetRadius, float SlowRadius) { steeringAgent = SteeringAgent; kineticsAgent = KineticsAgent; kineticsTarget = KineticsTarget; arrive = new Arrive(kineticsAgent, kineticsTarget, MaxAccel, MaxSpeed, TargetRadius, SlowRadius, 0.1f); }
public Arrive(Kinetics Character, Kinetics Target, float MaxAcceleration, float MaxSpeed, float TargetRadius, float SlowRadius, float TimeToTarget) { character = Character; target = Target; maxAcceleration = MaxAcceleration; maxSpeed = MaxSpeed; targetRadius = TargetRadius; slowRadius = SlowRadius; timeToTarget = TimeToTarget; }
public Align(Kinetics Character, Kinetics Target, float MaxAngularAccel, float MaxRotation, float TargetRadius, float SlowRadius, float TimeToTarget) { character = Character; target = Target; maxAngularAccel = MaxAngularAccel; maxRotation = MaxRotation; targetRadius = TargetRadius; slowRadius = SlowRadius; timeToTarget = TimeToTarget; }
public Cohesion(Kinetics Character, Transform[] Targets, float MaxAcceleration, float MaxSpeed, float TargetRadius, float SlowRadius, float TimeToTarget) { character = Character; targets = Targets; maxAcceleration = MaxAcceleration; maxSpeed = MaxSpeed; targetRadius = TargetRadius; slowRadius = SlowRadius; timeToTarget = TimeToTarget; }
// Start is called before the first frame update void Start() { //DATOS DE PERSONAJE kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //ARRIVE INITIALIZATION enemy = new GameObject();//creamos un enemigo ficticio que sera el mouse enemy.transform.position = Vector3.zero; kineticsEnemy = new Kinetics(0f, Vector3.zero, enemy.transform); arrive = new Arrive(kineticsAgent, kineticsEnemy, maxAccelerationArrive, agent.maxspeed, targetRadiusArrive, slowRadiusArrive, timeTotargetArrive); arrive.weigth = 1f; //AVOID INITIALIZATION obstacles = GameObject.FindGameObjectsWithTag("Obstacle"); for (int i = 0; i < obstacles.Length; i++) { obs_trans.Add(obstacles[i].transform); } Transform[] obstacles_transforms = obs_trans.ToArray(); obstacleAvoidance = new ObstacleAvoidance(kineticsAgent, obstacles_transforms, avoidDistance, lookAheadAvoid, steeringAgent); obstacleAvoidance.weigth = 1f; //FACE INITIALIZATION face = new Face(kineticsAgent, kineticsEnemy); face.weigth = 1f; //BLEND INITIALIZATION behaviorsArrive[0] = arrive; behaviorsArrive[1] = face; behaviorsAvoid[0] = obstacleAvoidance; blendArrive = new BlendedSteering(behaviorsArrive, maxAccelBlend, maxAngularBlend); blendAvoid = new BlendedSteering(behaviorsAvoid, maxAccelBlend, maxAngularBlend); //PRIORITY INITIALIZATION groups[0] = blendAvoid;//OJO avoid tiene prioridad por eso va primero groups[1] = blendArrive; priority = new PrioritySteering(groups, steeringAgent); }
// Start is called before the first frame update void Start() { //Inicializamos las estructuras necesarias de otros componentes enemy = GameObject.Find(enemyName).GetComponent <static_data>(); kineticsEnemy = enemy.kineticsAgent; kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; face = new Face(kineticsAgent, kineticsEnemy); }
void Start() { //Inicializamos las estructuras necesarias de otros componentes enemy = GameObject.Find(enemyName).GetComponent <static_data>(); kineticsEnemy = enemy.kineticsAgent; kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //Inicializamos movimientos pursue = new Pursue(kineticsAgent, kineticsEnemy, maxPrediction); }
void Start() { //Inicializamos las estructuras necesarias de otros componentes enemy = GameObject.Find(enemyName).GetComponent <static_data>(); kineticsEnemy = enemy.kineticsAgent; kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //Inicializamos movimientos kinematicSeek = new KinematicSeek(kineticsAgent, kineticsEnemy, maxSeekSpeed); }
// Start is called before the first frame update void Start() { //Inicializamos las estructuras necesarias de otros componentes enemy = GameObject.Find(enemyName).GetComponent <static_data>(); kineticsEnemy = enemy.kineticsAgent; kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //Inicializamos movimientos align = new Align(kineticsAgent, kineticsEnemy, maxAngularAccel, maxRotation, targetRadius, slowRadius, timeToTarget); }
void Start() { //Inicializamos las estructuras necesarias de otros componentes enemy = GameObject.Find(enemyName).GetComponent <static_data>(); kineticsEnemy = enemy.kineticsAgent; kineticsAgent = agent.kineticsAgent; steeringAgent = agent.steeringAgent; //Inicializamos movimientos velMatch = new VelocityMatch(kineticsAgent, kineticsEnemy, MaxAcceleration, timeTotarget); }