Advertisement
Placido_GDD

Player_Carrier

Dec 2nd, 2021
1,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1.  
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5.  
  6. public class Player_Carrier : Player
  7. {
  8.     protected DroneManager d_Manager;
  9.  
  10.     // Start is called before the first frame update
  11.     void Start()
  12.     {
  13.         d_Manager = base.player.GetComponent<DroneManager>();
  14.         base.Init();
  15.     }
  16.  
  17.     // Update is called once per frame
  18.     void Update()
  19.     {
  20.         base.Update();
  21.  
  22.       if (Input.GetMouseButton(1))
  23.             {
  24.                 base.AssignPoint();
  25.                 //base.Rotate();
  26.                 base.isMoving = true;
  27.             }
  28.       else if (Input.GetMouseButton(0))
  29.         {
  30.             base.AssignPoint();
  31.             d_Manager.AssignTarget();
  32.         }
  33.         if (Input.GetKeyDown(KeyCode.T))
  34.         {
  35.             if ((d_Manager.selectedTarget != null)&&(d_Manager.distFromEnemy <= d_Manager.droneRange))
  36.             {
  37.                 d_Manager.SpawnInterceptors();
  38.             }
  39.         }
  40.         else if (Input.GetKeyDown(KeyCode.Y))
  41.         {
  42.             d_Manager.RecallInterceptors();
  43.         }
  44.  
  45.         else if (Input.GetKeyDown(KeyCode.S))
  46.         {
  47.             base.isMoving = false;
  48.  
  49.         }
  50.  
  51.         if (d_Manager.distFromEnemy >= d_Manager.droneRange)
  52.         {
  53.             d_Manager.RecallInterceptors();
  54.             Debug.Log("Out of Range");
  55.         }
  56.     }
  57.  
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement