예제 #1
0
 void Start()
 {
     if (mainCamera == null)
     {
         mainCamera = gameObject.GetComponentInParent <MobileUI>().MainGunCamera;
     }
 }
예제 #2
0
    void Start()
    {
        if (player == null)
        {
            player = ScoreKeeper.playerAlive.GetComponent <PlayerControllerAlpha>();
        }

        //  availableGuns = player.activeChassis.transform
        //    availableGuns = GameObject.FindGameObjectsWithTag("PlayerGun");

        mainCameraShell = GameObject.FindGameObjectWithTag("CameraControl").GetComponent <GunCamera>();
        turretAim       = false;
        firingZero      = GameObject.FindGameObjectWithTag("fireZero");

        WeaponSwitch(currentGun);
    }
예제 #3
0
    //public GunCamera mainCam;

    // Update is called once per frame
    void Update()
    {
        ColorBlock colorEdit = gameObject.GetComponent <Button> ().colors;

        if (GunCamera.isLockedOn())
        {
            colorEdit.normalColor      = on;
            colorEdit.highlightedColor = on;
            gameObject.GetComponent <Button> ().colors = colorEdit;
        }
        else
        {
            colorEdit.normalColor      = off;
            colorEdit.highlightedColor = off;
            gameObject.GetComponent <Button> ().colors = colorEdit;
        }
    }
예제 #4
0
 void InitUI()
 {
     if (gamecontrols == null)
     {
         gamecontrols = this;
     }
     if (MainGunCamera == null)
     {
         MainGunCamera = GameObject.FindGameObjectWithTag("CameraControl").GetComponent <GunCamera>();
     }
     if (FireControlScript == null)
     {
         FireControlScript = GameObject.FindGameObjectWithTag("FireControlScript").GetComponent <ForwardFiring>();
     }
     //  if (mainPlayer == null)
     //      mainPlayer = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControllerAlpha>();
     if (Fold == null)
     {
         Fold = GameObject.FindGameObjectWithTag("FoldDrive").GetComponent <JumpFold>();
     }
 }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        activeCamera = this;

        if (storyController.Narrating && storyController.disableCam)
        {
            GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().enabled = false;
            camReEnable = true;
        }
        //dead man switch, will reenable after narration done
        else if (camReEnable)
        {
            GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>().enabled = true;
            camReEnable = false;
        }



        //        if (MobileControls.FireStick != null)
        //		{
        //			if (ScoreKeeper.playerAlive.GetComponent<PlayerControllerAlpha> ().tiltControl == true) {
        //                MobileControls.FireStick.gameObject.SetActive (true);
        //			}
        //
        //			else {
        //                MobileControls.FireStick.gameObject.SetActive (false);
        //
        //			}
        //		}

        float mouseW = Input.mouseScrollDelta.y;

        wheelPos = wheelPos - mouseW;

        //max wheel
        if (wheelPos > 9)
        {
            wheelPos = 9;
        }
        //min wheel
        if (wheelPos < -9)
        {
            wheelPos = -9;
        }

        //zoom alter

        /*
         * if (ScoreKeeper.playerAlive.GetComponent<PlayerControllerAlpha>().docked)
         * {
         *
         *  camSize = scalar * (1 + (0.1f * 50.0f));
         * }
         * else    */
        {
            camSize = scalar * (1 + (0.1f * wheelPos));
        }

        transform.localScale = camSize;

        cockpitView = (wheelPos < -3);
        //ScoreKeeper.playerAlive.GetComponent<PlayerControllerAlpha>().activeChassis.cockpit.SetActive(cockpitView);
        //ScoreKeeper.playerAlive.GetComponent<PlayerControllerAlpha>().activeChassis.shipModel.SetActive(!cockpitView);

        PlayerControls.cockpitMode(cockpitView);

        if (lockToGimbal && PlayerControls.getPlayerShip() != null)
        {
            if (PlayerControls.getPlayerShip().getShipGimbal() != null)
            {
                CameraFocus = PlayerControls.getPlayerShip().getShipGimbal().gameObject;
            }
            else
            {
                lockToGimbal = false;
                Debug.Log("No gimbal found");
            }
        }
        else if (!lockToGimbal)
        {
            CameraFocus = PlayerControls.getPlayerShip().gameObject;
        }

        else
        {
            target = DialogueBox.tracking;
        }
    }
예제 #6
0
 void Awake()
 {
     mainCamera = gameObject.GetComponentInParent <MobileUI>().MainGunCamera;
 }