Пример #1
0
    // Awake
    protected override void Awake()
    {
        base.Awake();

        // Controller
        controller = new HumanController(this);

        // Input manager
        inputManager = InputManager.instance;
        buttons      = new HumanController.InputButtons(inputManager);

        // Make the camera follow me
        var cameraModes = GameObject.Find("CameraModes");

        cameraModes.transform.parent        = myTransform;
        cameraModes.transform.localPosition = Cache.vector3Zero;
        cameraModes.transform.localRotation = Cache.quaternionIdentity;

        // Assign values
        camPivot   = GameObject.FindGameObjectWithTag("CamPivot");
        cameraMode = camPivot.GetComponent <CameraMode>();
        crossHair  = GetComponent <CrossHair>();

        // Set main player
        Player.main           = this;
        Player.main.isVisible = true;

        // Destroy
        onDestroy += () => {
            Player.main = null;
        };

        // ChangeParty
        onChangeParty += UpdateCameraYRotation;
    }
Пример #2
0
    // Awake
    protected override void Awake()
    {
        base.Awake();

        // Controller
        controller = new HumanController(this);

        // Input manager
        inputManager = InputManager.instance;
        buttons = new HumanController.InputButtons(inputManager);

        // Make the camera follow me
        var cameraModes = GameObject.Find("CameraModes");
        cameraModes.transform.parent = myTransform;
        cameraModes.transform.localPosition = Cache.vector3Zero;
        cameraModes.transform.localRotation = Cache.quaternionIdentity;

        // Assign values
        camPivot = GameObject.FindGameObjectWithTag("CamPivot");
        cameraMode = camPivot.GetComponent<CameraMode>();
        crossHair = GetComponent<CrossHair>();

        // Set main player
        Player.main = this;
        Player.main.isVisible = true;

        // Destroy
        onDestroy += () => {
            Player.main = null;
        };

        // ChangeParty
        onChangeParty += UpdateCameraYRotation;
    }