Example #1
0
    public static void ExitCannon()
    {
        if (currentCannon != null)
        {
            currentCannon.StartCoroutine(LeaveCannon());
            currentCannon.Selected = false;
            currentCannon.DestroyIndicator();
            currentCannon.ReturnToDefault();

            if (!currentCannon.C.Moved)
            {
                HighlightMaster.HighlightUnitToggle(true, currentCannon.C);
            }

            currentCannon = null;

            soundM.ButtonPress();
        }
    }
Example #2
0
 private static void ScanForCannon()
 {
     if (Input.GetKeyDown(KeyCode.Mouse0) /*&& Events.GetComponent<Pause>().paused == false*/)
     {
         Ray        ray;
         RaycastHit hit;
         ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         if (Physics.Raycast(ray, out hit))
         {
             Cannon c = hit.transform.gameObject.GetComponent <Cannon>();
             if (c != null)
             {
                 if (c.player == PlayerMaster.CurrentTurn && !c.Moved && c.shots != 0)
                 {
                     currentCannon = hit.transform.GetComponentInChildren <CannonControll>();
                     CurrentPowerShow();
                     currentCannon.Selected = true;
                     currentCannon.StartCoroutine(CannonMaster.MoveToCannon());
                 }
             }
         }
     }
 }
Example #3
0
 public static void SetAICannon(Cannon can)
 {
     currentCannon          = can.GetComponentInChildren <CannonControll>();
     currentCannon.Selected = true;
     currentCannon.StartCoroutine(CannonMaster.MoveToCannon());
 }