Exemplo n.º 1
0
        // Use this for initialization
        private void Start()
        {
            driver     = GetComponent <CharacterDriver>();
            mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
            GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>().player = gameObject;
            canvas = GameObject.Find("UI Canvas").GetComponent <Canvas>();

            helpTextObject = Instantiate(helpText, canvas.transform).GetComponent <HelpTextDisplayer>();
            canMove        = true;
        }
Exemplo n.º 2
0
 private void driver_StateChanged(CharacterDriver sender, StateChangedEventArgs e)
 {
     if (sender.controller != null)
     {
         if (e.beforeState == states.boardedShip && e.afterState == states.steeringShip)
         {
             LeanTween.cancel(sender.controller.mainCamera.gameObject);
             LeanTween.value(sender.controller.mainCamera.gameObject, val => sender.controller.mainCamera.orthographicSize = val, sender.controller.mainCamera.orthographicSize, sender.controller.interactingCameraSize, sender.controller.cameraEaseTime).setEase(LeanTweenType.easeInOutQuad);
         }
         if (e.beforeState == states.steeringShip && e.afterState == states.boardedShip)
         {
             LeanTween.cancel(sender.controller.mainCamera.gameObject);
             LeanTween.value(sender.controller.mainCamera.gameObject, val => sender.controller.mainCamera.orthographicSize = val, sender.controller.mainCamera.orthographicSize, sender.controller.walkingCameraSize, sender.controller.cameraEaseTime).setEase(LeanTweenType.easeInOutQuad);
         }
     }
 }
Exemplo n.º 3
0
 public void Update()
 {
     if (!player)
     {
         player = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterDriver>();
     }
     if (player)
     {
         transform.position = player.transform.position + offset;
         if (player.state == states.steeringShip && GameManager.options.game.MinimapRotateWithShip)
         {
             transform.rotation = player.shipBorded.transform.rotation;
         }
         else if (player.state != states.steeringShip && GameManager.options.game.MinimapRotateWithPlayer)
         {
             transform.rotation = player.sprite.transform.rotation;
         }
         else
         {
             //Doesnt work
             transform.rotation = Quaternion.identity;
         }
     }
 }
Exemplo n.º 4
0
 public void Start()
 {
     GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>().minimapCameraBlackout = gameObject.GetComponent <CameraBlackout>();
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterDriver>();
 }