예제 #1
0
 public void Init(NavMeshAgent agent,
                  Transform controllerTransform,
                  Transform modelTransform,
                  MonsterCollider collider)
 {
     _agent = agent;
     _controllerTransform = controllerTransform;
     _modelTransform      = modelTransform;
     _collider            = collider;
 }
예제 #2
0
    private void Tm_CollisionEnter_FireBall(object sender, RFX4_TransformMotion.RFX4_CollisionInfo e)
    {
        Debug.Log(e.Hit.transform.name); //will print collided object name to the console.
        Transform hitTransform = e.Hit.transform;

        if (hitTransform.tag == "Ice")
        {
            hitTransform.GetComponent <IceFragBurst>().Do();
        }

        MonsterCollider monsterCollider = e.Hit.transform.GetComponent <MonsterCollider>();

        if (monsterCollider)
        {
            MonsterController monsterController = monsterCollider.GetMonsterController();
            monsterController.GetAttack(MonsterController.DamageType.Fu, PlayerStatus.FireBallAttack);
            //monsterCollider.GetMonsterController().GetAttack(fireBallAttack);
        }
    }
예제 #3
0
        //La lista de triggers y la de spawnPoints deben ser del mismo tamaño
        public void Init(TgcMesh mesh, /*Vector3 startPos, List<Core.BoundingVolumes.TgcBoundingSphere> triggers, List<Vector3> spawnPoints,*/ List <Vector3> recorrido)
        {
            this.mesh             = mesh;
            this.rangoInmediatoSq = 1000.0f;
            sphere = Core.BoundingVolumes.TgcBoundingSphere.computeFromMesh(mesh);
            sphere.setValues(sphere.Center, 20);
            Position = recorrido[0];
            //this.triggers = triggers;
            //this.spawnPoints = spawnPoints;
            this.recorrido = recorrido;
            nextNode       = 1;
            chasingPlayer  = false;
            rotation_speed = 0.1f;

            //1    -> 0
            //0.5  -> 60
            //0    -> 180
            //-0.5 -> 300
            //-1   -> 360
            rangoVision = 0.2f;

            target           = recorrido[nextNode];
            collisionManager = new MonsterCollider();
        }