Exemplo n.º 1
0
        void LateUpdate()
        {
            playerPosition = GameServices.Get <PlayerManager>().PlayerPosition;
            Vector3 worldPosition = (Vector3.forward * -distance) + (Vector3.up * height);

            Debug.DrawLine(playerPosition, worldPosition, Color.red);

            Vector3 rotationVector = Quaternion.AngleAxis(angle, Vector3.up) * worldPosition;

            Debug.DrawLine(playerPosition, rotationVector, Color.blue);

            Debug.DrawLine(playerPosition, worldPosition, Color.green);


            //Vector3 flatTargetPosition = player.GetComponent<Rigidbody>().position;
            //flatTargetPosition.y = 0;

            Vector3 finalPosition = playerPosition + rotationVector;

            Debug.DrawLine(playerPosition, finalPosition, Color.blue);

            transform.position = Vector3.SmoothDamp(transform.position, finalPosition, ref smoothVelociy, smoothingSpeed);
            transform.LookAt(playerPosition);
        }
Exemplo n.º 2
0
 void SpawnEnemiesByOne()
 {
     GameServices.Get <EnemySpawnerManager>().SpawnEnemyOnRandomPoint();
 }
Exemplo n.º 3
0
 public override void Release()
 {
     GameServices.Get <GameScoreManager>().Unregister(this);
     //health.OnHealthDepleted -= OnDestroyEnemy;
     health.OnHealthDepleted -= Explode;
 }
Exemplo n.º 4
0
 void SetTargetPosition()
 {
     target = GameServices.Get <PlayerManager>().PlayerPosition;
 }
Exemplo n.º 5
0
        public float maxIntensity = 3f;     // The maximum intensity the flash will reach
        void Start()
        {
            cam = GameServices.Get <CameraService>().MainCamera;

            //StartCoroutine(nameof(flashNow));
        }
Exemplo n.º 6
0
 void Start()
 {
     cam            = GameServices.Get <CameraService>().MainCamera;
     playerPosition = GameServices.Get <PlayerManager>().PlayerPosition;
 }
Exemplo n.º 7
0
 public override void Release()
 {
     GameServices.Get <AsteroidsService>().Unregister(this);
 }
Exemplo n.º 8
0
 public override void Init(Action onRelease)
 {
     GameServices.Get <AsteroidsService>().Register(this);
     Invoke(nameof(Explode), 30f);
     OnDestroy += onRelease;
 }
Exemplo n.º 9
0
 public override void Release()
 {
     GameServices.Get <CubeEnemy1Service>().Unregister(this);
 }
Exemplo n.º 10
0
        public override void Init(Action onRelease)
        {
            GameServices.Get <CubeEnemy1Service>().Register(this);

            OnDestroy += onRelease;
        }