Example #1
0
    SteeringOutput steering; //steering del personaje

    public FaceToSeenTarget(SightSensor Sensor, Kinetics Character, SteeringOutput Steering)
    {
        face      = new Face(Character, Character);
        sensor    = Sensor;
        character = Character;
        steering  = Steering;
    }
Example #2
0
    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;
    }
Example #3
0
    void Start()
    {
        //Inicializamos las estructuras necesarias

        steeringAgent = agent.steeringAgent;
        kineticsAgent = agent.kineticsAgent;
    }
Example #4
0
    // 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;
    }
Example #6
0
 public Separation(Kinetics Character, Kinetics[] Targets, float Threshold, float MaxAccel)
 {
     character = Character;
     targets   = Targets;
     threshold = Threshold;
     maxAccel  = MaxAccel;
 }
Example #7
0
 public CollisionAvoidance(Kinetics Character, float MaxAccel, Kinetics[] Targets, float Radius)
 {
     character = Character;
     maxAccel  = MaxAccel;
     targets   = Targets;
     radius    = Radius;
 }
Example #8
0
    // Start is called before the first frame update
    void Start()
    {
        kineticsAgent = agent.kineticsAgent;
        steeringAgent = agent.steeringAgent;

        follow = new FollowPath(kineticsAgent, maxSeekAccel, pathOffset);
    }
Example #9
0
 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;
 }
Example #12
0
 public UpdateAStar(Stack <Kinetics> Pokemons, PathFindAStar AStar, Graph Graph, Kinetics KinAgent, string[] Walkable)
 {
     pokemons = Pokemons;
     aStar    = AStar;
     graph    = Graph;
     kinAgent = KinAgent;
     walkable = Walkable;
 }
Example #13
0
    public void Start()
    {
        kball = ball.GetComponent <Kinetics> ();
        rball = ball.GetComponent <Renderer> ();
        ren   = gameObject.GetComponent <Renderer> ();

        racketLastPosition = mop.GetObjectPosition(ren);
    }
Example #14
0
 public FollowPathOfPoints(SteeringOutput SteeringAgent, Seek Seek, Vector3[] Path, bool Underground)
 {
     steeringAgent = SteeringAgent;
     seek          = Seek;
     agentKin      = seek.character;
     path          = Path;
     underground   = Underground;
 }
Example #15
0
 public KinematicArrive(Kinetics Character, Kinetics Target, float Maxspeed, float Time, float Radius)
 {
     character    = Character;
     target       = Target;
     maxspeed     = Maxspeed;
     timeToTarget = Time;
     radius       = Radius;
 }
Example #16
0
 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;
 }
Example #19
0
 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;
 }
Example #20
0
    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);
 }
Example #22
0
 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;
 }
Example #23
0
 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;
 }
Example #24
0
 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;
 }
Example #25
0
    // 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);
    }
Example #26
0
    // 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);
    }
Example #27
0
    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);
    }
Example #28
0
    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);
    }
Example #29
0
    // 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);
    }
Example #30
0
    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);
    }