コード例 #1
0
    void Awake()
    {
        playerCamera = Camera.main.transform;


        // Set up the references.
        behaviours           = new List <GenericBehaviour>();
        overridingBehaviours = new List <GenericBehaviour>();

        hFloat    = Animator.StringToHash("H");
        vFloat    = Animator.StringToHash("V");
        camScript = playerCamera.GetComponent <ThirdPersonOrbitCamBasic>();

        camScript.Setup(this.transform);

        rBody = GetComponent <Rigidbody>();

        unityAnim = GetComponent <Animator>();
    }
コード例 #2
0
        public override void Init(bool isOwner)
        {
            _isOwner     = isOwner;
            unityAnim    = GetComponent <Animator>();
            hFloat       = Animator.StringToHash("H");
            vFloat       = Animator.StringToHash("V");
            groundedBool = Animator.StringToHash("Grounded");
            jumpBool     = Animator.StringToHash("Jump");
            speedFloat   = Animator.StringToHash("Speed");
            colExtents   = GetComponent <Collider>().bounds.extents;
            if (_isOwner)
            {
                playerCamera = Camera.main.transform;
                rBody        = GetComponent <Rigidbody>();
                camScript    = playerCamera.GetComponent <ThirdPersonOrbitCamBasic>();

                camScript.Setup(this.transform);
            }

            _initialized = true;
        }