Ejemplo n.º 1
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(1))
     {
         var position = GetScreenPlanePosition(Input.mousePosition);
         playerMech.MoveTo(position);
         moveMarker.transform.position = position;
     }
     if (Input.GetMouseButtonDown(0))
     {
         var position = GetScreenPlanePosition(Input.mousePosition);
         playerMech.FireTo(position);
         fireMarker.transform.position = position;
     }
     ControlEnemyMechs();
     CheckWinConditions();
     if (stressTimer > 0)
     {
         stressTimer -= Time.deltaTime;
         sceneCamera.transform.localPosition = cameraPosition + Random.insideUnitSphere * stressTimer * 0.5f;
     }
     else
     {
         sceneCamera.transform.localPosition = cameraPosition;
     }
 }
Ejemplo n.º 2
0
    private void SetUnitAim(MechController enemy)
    {
        var dist  = Random.Range(1.0f, 2.5f);
        var point = playerMech.transform.position + new Vector3(Random.Range(-dist, dist), 0, Random.Range(-dist, dist));

        enemy.FireTo(point);
    }