Inheritance: MonoBehaviour, ICamera
示例#1
0
    public void OnEnable()
    {
        cutObjectsList     = CutObjectsPanel.transform.Find("Cut Objects List Section");
        addDeleteCutObject = CutObjectsPanel.transform.Find("Add Delete Cut Object Section");

        treeViewController = GameObject.Find("Scroll View/Viewport/Content").GetComponent <TreeViewController>();
        cameraController   = GameObject.Find("Main Camera Controller").GetComponent <MainCameraController>();

        cutObjectsSettingsGO = CutObjectsPanel.transform.Find("Cut Object Settings Section/Fuzzy Panel");
        decay             = cutObjectsSettingsGO.transform.Find("Decay");
        distance          = cutObjectsSettingsGO.transform.Find("Distance");
        gamma             = cutObjectsSettingsGO.transform.Find("Gamma");
        invertCut         = cutObjectsSettingsGO.transform.Find("Invert Cut");
        objectAlpha       = cutObjectsSettingsGO.transform.Find("Object Alpha");
        cutOpacity        = cutObjectsSettingsGO.transform.Find("Cut Opacity");
        cutAperture       = cutObjectsSettingsGO.transform.Find("Cut Aperture");
        weigthThreshold   = cutObjectsSettingsGO.transform.Find("Weight Threshold");
        quantityThreshold = cutObjectsSettingsGO.transform.Find("Quantity Threshold");
        densityThreshold  = cutObjectsSettingsGO.transform.Find("Density Threshold");
        plotPanel         = cutObjectsSettingsGO.transform.Find("Plot Panel");

        tutorialOrbiting  = GameObject.Find("Tutorial/Orbiting");
        tutorialZooming   = GameObject.Find("Tutorial/Zooming");
        tutorialPanning   = GameObject.Find("Tutorial/Panning");
        tutorialSelecting = GameObject.Find("Tutorial/Selecting");
        tutorialFinish    = GameObject.Find("Tutorial/Finish");

        //var path = Application.dataPath;
        //path += "/../Data/RecordedFlythroughs/tutorial.json"; // I think this will not work when I run this from build
        var path = "Data/RecordedFlythroughs/tutorial";



        InteractionRecorder.Get.LoadFlythroughs(path);
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        base.BaseInit();
        this.gameObject.tag = "NPC";
        cameraController    = GameObject.Find("MainController").GetComponent <MainCameraController>();
        uiController        = GameObject.Find("MainController").GetComponent <InterfaceController>();
        ioController        = GameObject.Find("MainController").GetComponent <InputController>();
        loc = new Location(transform.position.x, transform.position.y);
        if (commands.Count == 0)
        {
            commands = new List <string>();
        }

        commands.Insert(0, "Info");
        commands.Insert(1, "Talk");
        commandAmount = commands.Count;

        info = new NPC();
        info.objectHandle = this.gameObject;
        info.name         = name;

        animator = GetComponent <Animator>();
        if (null != animator)
        {
            animator.Play("Standing");
        }


        throwUpTimer        = 0.4f;
        throwUpRecoverTimer = 0.0f;
    }
示例#3
0
    void Start()
    {
        //Loading Resources
        deathSound   = Resources.Load <AudioClip> ("Musics/TopsToques-NaveEspacial8bitEfeitoSonoro");
        victorySound = Resources.Load <AudioClip> ("Musics/MyInstants-HellYeah");
        music        = Resources.Load <AudioClip> ("Musics/DarkLight-Vodovoz");
        chaveImg     = Resources.Load <Sprite> ("Graphics/Images/Key");

        //Finding References
        player            = GameObject.FindGameObjectsWithTag("Player");
        chaveSlot         = GameObject.FindGameObjectWithTag("ChaveSlot");
        highFive          = GameObject.FindGameObjectWithTag("High5");
        final             = GameObject.FindGameObjectWithTag("Final");
        gS                = GameObject.Find("GameSettings").GetComponent <GameSettings> ();
        mCC               = GameObject.Find("MainCamera").GetComponent <MainCameraController> ();
        audioManager      = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioSource> ();
        audioSource       = this.GetComponent <AudioSource> ();
        audioManager.clip = music;
        textoTempo        = GameObject.Find("Canvas/TextoTempo").GetComponent <Text> ();
        textoMetros       = GameObject.Find("Canvas/TextoMetros").GetComponent <Text> ();
        textoSlow         = GameObject.Find("Canvas/TextoTempoSlow");
        painelGameOver    = GameObject.Find("Canvas/PainelGameOver");
        textoGameOver     = GameObject.Find("Canvas/PainelGameOver/TextoGameOver");
        textoWin          = GameObject.Find("Canvas/PainelGameOver/TextoVitoria");
        textoScore        = GameObject.Find("Canvas/PainelGameOver/TextoScore");

        painelGameOver.SetActive(false);
        textoWin.SetActive(false);
    }
 private void Awake()
 {
     S          = this;
     mainCamera = Camera.main;
     camHeight  = mainCamera.orthographicSize;
     camWidth   = mainCamera.aspect * camHeight;
 }
示例#5
0
    void LoadValues()
    {
        controller = this.GetComponent <CharacterController>();

        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        if (camera == null)
        {
            Debug.Log("Camera not found!");
        }
        else
        {
            cameraController = camera.GetComponent <MainCameraController>();
        }

        jumpVelocity         = 2 * maxJumpHeight / timeToApex;
        gravityOnJumpHeld    = -jumpVelocity / timeToApex;
        gravityOnJumpRelease = jumpVelocity / minJumpHeight / 2 - jumpVelocity * jumpVelocity / minJumpHeight;

                #if DEBUG_CONSTANTS
        Debug.Log("Jump velocity: " + jumpVelocity);
        Debug.Log("Jump held gravity: " + gravityOnJumpHeld);
        Debug.Log("Jump released gravity: " + gravityOnJumpRelease);
                #endif

        velocity   = controller.velocity;
        checkpoint = transform.position;
    }
示例#6
0
    void Awake(){
        Inst = this;
        playerMovementExitsSnapCam = true;

        GameGUI.Inst.fadeAlpha = 1.5f;
        GameGUI.Inst.fadeOut = false;
    } // End of Awake().
示例#7
0
    private void CreateShooter(Army army)
    {
        GameObject           cameraObj  = GameObject.Find("MainCamera");
        MainCameraController controller = cameraObj.GetComponent <MainCameraController>();

        GameObject shooter = GameObject.Find("Shooter");

        Vector3    position = Vector3.zero;
        Quaternion rotation = Quaternion.identity;
        string     name     = "";

        if (army == Army.Army_Red)
        {
            position = controller.WorldSpaceToUnitSpace(new Vector3(0.0f, 7.0f, 0.0f));
            rotation = new Quaternion(0, 0, 0, 35);

            name = "red";
        }
        else if (army == Army.Army_Blue)
        {
            position = controller.WorldSpaceToUnitSpace(new Vector3(0.0f, -7.0f, 0.0f));
            rotation = new Quaternion(0, 0, 0, 155);

            name = "blue";
        }

        GameObject shooterObj = Instantiate(shooter, position, rotation);

        shooterObj.name = name;
        Shooter shooterScript = shooterObj.GetComponent <Shooter>();

        shooterScript.m_myArmy = army;
        shooterScript.PostStart();
    }
示例#8
0
 // Use this for initialization
 void Start()
 {
     snapDisplay       = transform.Find("SnapDisplay").GetComponent <MeshRenderer>().material.mainTexture;
     topLeftAnchor     = transform.Find("SnapTopLeft");
     bottomRightAnchor = transform.Find("SnapBottomRight");
     mainCam           = GameObject.Find("MainController").GetComponent <MainCameraController>();
     ioController      = GameObject.Find("MainController").GetComponent <InputController>();
 }
 private void OnEnable()
 {
     playerInfo.ComponentUpdated.Add(OnPlayerInfoUpdated);
     MainCameraController.SetTarget(gameObject);
     UIController.ShowUI();
     SceneManager.UnloadSceneAsync(SimulationSettings.SplashScreenScene);
     Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
 }
示例#10
0
    void Start()
    {
        RangeFieldItem = GetComponentInChildren <RangeFieldItem>();

        if (cameraController == null)
        {
            cameraController = FindObjectOfType <MainCameraController>();
        }
    }
示例#11
0
    public void OnEnable()
    {
        SetArrowState(IsFolded);

        if (cameraController == null)
        {
            cameraController = FindObjectOfType <MainCameraController>();
        }
    }
示例#12
0
    private void DoCutObjectPicking()
    {
        var        mousePos  = Event.current.mousePosition;
        Ray        CameraRay = Camera.main.ScreenPointToRay(new Vector3(mousePos.x, Screen.height - mousePos.y, 0));
        RaycastHit hit;

        // If we hit an object
        if (Physics.Raycast(CameraRay, out hit, 1000))
        {
            var cutObject       = hit.collider.gameObject.GetComponent <CutObject>();
            var transformHandle = hit.collider.gameObject.GetComponent <TransformHandle>();

            // If we hit a new selectable object
            if (cutObject && transformHandle && transformHandle != _selectedTransformHandle)
            {
                if (_selectedTransformHandle != null)
                {
                    //Debug.Log("Reset");
                    _selectedTransformHandle.Disable();
                }

                Debug.Log("Selected transform: " + transformHandle.gameObject.name);

                if (SelectionGameObject && SelectionGameObject.GetComponent <TransformHandle>())
                {
                    SelectionGameObject.GetComponent <TransformHandle>().Disable();
                }

                transformHandle.Enable();
                transformHandle.SetSelectionState(_currentState);
                _selectedTransformHandle = transformHandle;

                if (_mainCameraController == null)
                {
                    _mainCameraController = GameObject.FindObjectOfType <MainCameraController>();
                }

                _mainCameraController.TargetTransform = hit.collider.gameObject.transform;
                //MainCamera.main.GetComponent<NavigateCamera>().TargetGameObject = hit.collider.gameObject;
            }
            // If we hit a non-selectable object
            else if (transformHandle == null && _selectedTransformHandle != null)
            {
                //Debug.Log("Missed hit");
                _selectedTransformHandle.Disable();
                _selectedTransformHandle = null;
            }
        }
        // If we miss a hit
        else if (_selectedTransformHandle != null)
        {
            //Debug.Log("Missed hit");
            _selectedTransformHandle.Disable();
            _selectedTransformHandle = null;
        }
    }
示例#13
0
    /// <summary>
    /// 实例化摄像机
    /// </summary>
    /// <param name="trans"></param>
    private void InitCamera(Transform trans)
    {
        mainCamera           = GameObject.Find("Main Camera");
        mainCameraController = mainCamera.GetComponent <MainCameraController>();
        mainCameraController.SetFollower(trans);

        rotateCamera           = GameObject.Find("RotateCamera");
        rotateCameraController = rotateCamera.GetComponent <RotateCamera>();
        rotateCamera.SetActive(false);
    }
示例#14
0
 void Start()
 {
     animator     = GetComponent <Animator>();
     mainCam      = FindObjectOfType <MainCameraController>();
     currentLives = maxLives;
     this.GetComponent <Collider2D> ().enabled   = true;
     this.GetComponent <FollowObject> ().enabled = true;
     remainingInvincibiltiyTime = 0.0f;
     UpdateUI();
 }
    /******/

    void OnEnable()
    {
        if (_cameraController == null)
        {
            _cameraController   = FindObjectOfType <MainCameraController>();
            _treeViewController = FindObjectOfType <TreeViewController>();
            _panelsUIController = FindObjectOfType <PanelsUIController>();
            // TODO make more robust
        }
    }
示例#16
0
    // Use this for initialization
    void Start()
    {
        MainCameraController controller = Camera.main.GetComponent <MainCameraController> ();

        controller.SendMessage("PlayerSpawned", this.gameObject);

        body = GetComponent <Rigidbody2D> ();
        Manager.ObjectLog.Add(gameObject, this);
        GrapplingState = E_GrapplingState.Detached;
        InvokeRepeating("MapCheck", 0f, 0.5f);
    }
示例#17
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
示例#18
0
    void OnTriggerEnter(Collider other)
    {
        bool replace = (other.gameObject.GetComponent <CharacterController>() != null);

        Object.Destroy(other.gameObject);
        if (replace)
        {
            GameObject           P = (GameObject)GameObject.Instantiate(player, spawnPoint.position, player.transform.rotation);
            MainCameraController c = Camera.main.GetComponent <MainCameraController>();
            c.target = P.transform;
        }
    }
示例#19
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         _gameCamera = GetComponent<Camera>();
         CalculateOrtographicSize();
     }
     else
     {
         Destroy(gameObject);
     }
 }
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(this);
        }

        mainCamera = GetComponent <Camera>();
    }
示例#21
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
     mainCamera = GetComponent <Camera>();
 }
    // Start is called before the first frame update
    private void Start()
    {
        _rb = GetComponent <Rigidbody2D>();
        Debug.Assert(Camera.main != null, "Camera.main != null");
        _cameraController = Camera.main.GetComponent <MainCameraController>();
        _bigBlack         = GameObject.FindWithTag("BigBlack").GetComponent <SpriteRenderer>();

        // Special system stuff
        // Turn off interpolation if on WebGL
        if (Application.platform == RuntimePlatform.WebGLPlayer)
        {
            _rb.interpolation = RigidbodyInterpolation2D.None;
        }
    }
示例#23
0
    // =======================
    // ==	FUNCTION CALLS	==
    // =======================

    void Awake()
    {
        _grid   = GetComponent <FormGrid> ();
        _maze   = GetComponent <FormMaze> ();
        _camera = GetComponent <MainCameraController> ();

        // add components to a List
        _startSequence = new List <IGameManager> ();
        _startSequence.Add(_grid);
        _startSequence.Add(_maze);
        _startSequence.Add(_camera);

        StartCoroutine(StartUpManagers());
    }
示例#24
0
    // Update is called once per frame
    void Update()
    {
        bool oneVisible = false; //At least one player is visible

        foreach (GameObject g in playersInVision)
        {
            if (!g.GetComponent <PlayerController>().hidden)
            {
                oneVisible = true;

                //Player not hidden
                if (!hasDetected)
                {
                    hasDetected = true;
                    spottedTime = Time.time + findTime;
                }
            }
        }

        if (!oneVisible)
        {
            //If none is visible anymore, don't spot
            hasDetected = false;
        }

        if (hasDetected && Time.time > spottedTime)
        {
            hasDetected = false;
            //Debug.Log("Spotted");

            foreach (GameObject g in playersInVision)
            {
                if (!g.GetComponent <PlayerController>().hidden)
                {
                    //Tell main camera to do animation
                    GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
                    if (mainCamera)
                    {
                        MainCameraController mainCameraController = mainCamera.GetComponent <MainCameraController>();
                        if (mainCameraController)
                        {
                            mainCameraController.SpotPlayer(g.gameObject);
                        }
                    }
                    break;
                }
            }
        }
    }
示例#25
0
    void Awake()
    {
        MainCamera = GameObject.Find("Main Camera").GetComponent <MainCameraController> ();
        rigi       = this.GetComponent <Rigidbody> ();
        //if (isLocalPlayer) {
        if (this.transform.position.x < 6)
        {
            xPos = 0;
        }
        else
        {
            xPos = 2;
        }

        //}
    }
示例#26
0
    void Awake()
    {
        instance = this;

        if (Application.loadedLevelName == "MainMenu")
        {
            gameState = GlobalInfo.GameState.MENU;
        }
        else
        {
            gameState = GlobalInfo.GameState.INGAME;
        }

        MainCameraController.FindOrCreate();
        SoundController.FindOrCreate();
    }
    public void AwakenReaction()
    {
        if (LeftEye.activeInHierarchy || RightEye.activeInHierarchy)
        {
            //cannot wake again!
            return;
        }
        MainCameraController.ShakeCameraEpic();

        //Jolt
        LeanTween.rotateLocal(cogsHolder, cogWobble.localEulerAngles, 0.2f).setEaseOutBack().setLoopPingPong(1);
        //Animate
        OpenEyes();
        //rotate for pain
        LeanTween.rotate(LeftEye, Vector3.down, 0.2f).setEase(LeanTweenType.easeInSine).setLoopPingPong(1);
        LeanTween.rotate(RightEye, Vector3.down, 0.2f).setEase(LeanTweenType.easeInSine).setLoopPingPong(1).setOnComplete(() =>
        {
            StartCoroutine(BlinkEyes(0.5f));
        });
    }
示例#28
0
    // Use this for initialization
    void Start()
    {
        thePlayer = FindObjectOfType <PlayerController> ();
        boundBox  = FindObjectOfType <BoundBox> ().GetComponent <PolygonCollider2D> ();

        if (thePlayer.startPoint == pointName)
        {
            thePlayer.transform.position = transform.position;
            thePlayer.direction          = startDirection;

            theMainCamera = FindObjectOfType <MainCameraController> ();
            theMainCamera.transform.position = new Vector3(transform.position.x, transform.position.y, theMainCamera.transform.position.z);

            theVirtualCamera = FindObjectOfType <VirtualCameraController> ();
            theVirtualCamera.transform.position = new Vector3(transform.position.x, transform.position.y, theVirtualCamera.transform.position.z);
            // boundingAreaObject = GameObject.FindWithTag ("BoundingArea");
            // boundingArea = boundingAreaObject.gameObject.GetComponent<PolygonCollider2D> ();
            theVirtualCamera.gameObject.GetComponent <Cinemachine.CinemachineConfiner> ().m_BoundingShape2D = boundBox;
        }
    }
示例#29
0
文件: Shooter.cs 项目: highdt/avartar
    // Use this for initialization
    void Start()
    {
        m_body        = GetComponent <Rigidbody2D>();
        m_render      = GetComponent <SpriteRenderer>();
        m_myTransform = m_body.transform;

        // shooting control
        m_shootingStrength = 1.0f;
        m_speed            = 1.0f;
        m_isShooting       = false;
        m_shootingCooldown = 3.0f;
        m_lastShoointgTime = -m_shootingCooldown;

        m_scaleSpeed = 0.01f;
        m_maxScaling = 0.7f;
        m_minScaling = 0.35f;

        m_world    = GameObject.Find("MainCamera").GetComponent <MainCameraController>();
        m_isPlayer = m_myArmy == MainGame.Army.Army_Blue;
    }
示例#30
0
    // Use this for initialization
    void Start()
    {
        cameraController      = GetComponent <MainCameraController>();
        ioController          = GetComponent <InputController>();
        convoController       = GetComponent <ConversationController>();
        hero                  = GameObject.Find("Hero").GetComponent <HeroController>();
        drunkBarStartingScale = drunkBar.transform.localScale;
        pointsText            = pointsTextObject.GetComponent <Text>();
        drunkLevel            = 0;
        startingDrunkLevel    = 50;
        currentPoints         = 0;
        selectionGroupDepth   = -4.0f;
        blackedOut            = false;
        blackOutTimer         = 3.0f;
        heroDrunk             = false;
        brownOutTimer         = 10.0f;

        WipeUI();
        UpdateUI();
    }
示例#31
0
    // Use this for initialization
    void Start()
    {
        grid             = GetComponent <GridController>();
        cameraController = GetComponent <MainCameraController>();
        itemController   = GetComponent <InteractableController>();
        uiController     = GetComponent <InterfaceController>();
        convoController  = GetComponent <ConversationController>();
        textController   = GetComponent <TextController>();
        hero             = GameObject.Find("Hero").GetComponent <HeroController>();

        isScrolling        = false;
        canClick           = true;
        canScroll          = true;
        scrollTimerVal     = .2f;
        isScrollingTimer   = scrollTimerVal;
        supportsMultiTouch = Input.multiTouchEnabled;
        textShowing        = false;
        clickTimer         = 0.0f;

        mouseX = 0.0f;
        mouseY = 0.0f;
    }
    /// <summary>
    /// Unity's method called on start script only one time
    /// </summary>
    void Start()
    {
        // Retrieves the components of the entities.
        _collider = gameObject.GetComponent<BoxCollider>();

        // Retrieves the components of the entity.
        _cameraController = FindObjectOfType<MainCameraController>();

        // Looks for the independent controller component
        _independentControl = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameControllerIndependentControl>();
    }
    void Awake()
    {
        //Get the camera controller
        _cameraController = GetComponentInChildren<MainCameraController>();

        //Get the mext drop number for label
        _dropNameCounter = allCurrentCharacters.Count;
    }
 void Awake()
 {
     _instance = this;
 }
    void Start()
    {
        // Get the references to the required objects
        _gci = GetComponentInParent<GameControllerInput>();
        _mcc = GetComponentInParent<MainCameraController>();
        _cameraAnimator = GetComponent<Animator>();

        // Stops the input
        _gci.ResumeInput();
    }
示例#36
0
    public void SetSelectedObject(int instanceID)
    {
        if (instanceID >= CPUBuffers.Get.ProteinInstancePositions.Count) return;

        Debug.Log("*****");

        //if (!ValidateInstanceID(_selectedObjectID)) return;

        Debug.Log("Selected element id: " + instanceID); if (instanceID >= CPUBuffers.Get.ProteinInstancePositions.Count) return;
        if (instanceID > 0) Debug.Log("Selected element type: " + CPUBuffers.Get.ProteinInstanceInfos[instanceID].x);
        if (instanceID > 0) Debug.Log("Selected element name: " + SceneManager.Get.ProteinIngredientNames[(int)CPUBuffers.Get.ProteinInstanceInfos[instanceID].x]);
        
        // If element id is different than the currently selected element
        if (_selectedObjectID != instanceID)
        {
            // if new selected element is greater than one update set and set position to game object
            if (instanceID > -1 )
            {
                if (_ctrlKeyFlag)
                {
                    float radius = CPUBuffers.Get.ProteinIngredientsRadii[(int)CPUBuffers.Get.ProteinInstanceInfos[instanceID].x] * GlobalProperties.Get.Scale;

                    SelectionGameObject.GetComponent<SphereCollider>().radius = radius;

                    SelectionGameObject.transform.position = CPUBuffers.Get.ProteinInstancePositions[instanceID] * GlobalProperties.Get.Scale;
                    SelectionGameObject.transform.rotation = MyUtility.Vector4ToQuaternion(CPUBuffers.Get.ProteinInstanceRotations[instanceID]);

                    // Enable handle
                    SelectionGameObject.GetComponent<TransformHandle>().Enable();
                    //MainCamera.main.GetComponent<NavigateCamera>().TargetGameObject = SelectionGameObject;
                    if (controller == null)
                    {
                        controller = GameObject.FindObjectOfType<MainCameraController>();
                    }
                    controller.TargetTransform = SelectionGameObject.transform; 

                    if (_selectedTransformHandle)
                    {
                        _selectedTransformHandle.Disable();
                        _selectedTransformHandle = null;
                    }

                    _ctrlKeyFlag = false;
                    _selectedObjectID = instanceID;
                    _selectedTransformHandle = SelectionGameObject.GetComponent<TransformHandle>();
#if UNITY_EDITOR
                    Selection.activeGameObject = SelectionGameObject;
#endif
                }

            }
            else
            {
                // Disable handle
                SelectionGameObject.GetComponent<TransformHandle>().Disable();
                _selectedObjectID = instanceID;
            }
        }
    }
示例#37
0
    private void DoCutObjectPicking()
    {
        var mousePos = Event.current.mousePosition;
        Ray CameraRay = Camera.main.ScreenPointToRay(new Vector3(mousePos.x, Screen.height - mousePos.y, 0));
        RaycastHit hit;

        // If we hit an object
        if (Physics.Raycast(CameraRay, out hit, 1000))
        {
            var cutObject = hit.collider.gameObject.GetComponent<CutObject>();
            var transformHandle = hit.collider.gameObject.GetComponent<TransformHandle>();

            // If we hit a new selectable object
            if (cutObject && transformHandle && transformHandle != _selectedTransformHandle)
            {
                if (_selectedTransformHandle != null)
                {
                    //Debug.Log("Reset");
                    _selectedTransformHandle.Disable();
                }

                Debug.Log("Selected transform: " + transformHandle.gameObject.name);

                if (SelectionGameObject && SelectionGameObject.GetComponent<TransformHandle>())
                {
                    SelectionGameObject.GetComponent<TransformHandle>().Disable();
                }

                transformHandle.Enable();
                transformHandle.SetSelectionState(_currentState);
                _selectedTransformHandle = transformHandle;

                if (_mainCameraController == null)
                    _mainCameraController = GameObject.FindObjectOfType<MainCameraController>();

                _mainCameraController.TargetTransform = hit.collider.gameObject.transform;
                //MainCamera.main.GetComponent<NavigateCamera>().TargetGameObject = hit.collider.gameObject;
            }
            // If we hit a non-selectable object
            else if (transformHandle == null && _selectedTransformHandle != null)
            {
                //Debug.Log("Missed hit");
                _selectedTransformHandle.Disable();
                _selectedTransformHandle = null;
            }
        }
        // If we miss a hit
        else if (_selectedTransformHandle != null)
        {
            //Debug.Log("Missed hit");
            _selectedTransformHandle.Disable();
            _selectedTransformHandle = null;
        }
    }
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible = false;;
     //Application.targetFrameRate = 600;
     height = Screen.currentResolution.height;
     width = Screen.currentResolution.width;
     Debug.Log ("W: " + width + " H: " + height);
     rb = gameObject.GetComponent<Rigidbody>(); //k then
     anime = gameObject.GetComponent<Animator> ();
     rotProxy = GameObject.FindGameObjectWithTag ("rotProxy");
      camera = GameObject.FindGameObjectWithTag ("MainCamera");
     cameraScript = camera.GetComponent<MainCameraController> ();
     mSpeed = omSpeed;
     controlScheme = ControlScheme.MMO;
 }
示例#39
0
	// Use this for initialization
	void Start () {
        cameraBounds = new BoundsBox(transform.position);
        sInstance = this;
        m_desiredCamPoint = transform.position;
    }