Пример #1
0
 /// <summary>
 /// Disable old controller, switch active controller, and enable new controller
 /// </summary>
 private void SwitchController()
 {
     activeController.enabled = false;
     if (activeController == catBoyController)
     {
         activeController = catFormController;
     }
     else
     {
         activeController = catBoyController;
     }
     activeController.enabled = true;
 }
Пример #2
0
    private void Start()
    {
        Debug.Log("HIII");
        activeCharacter  = catBoy;
        activeController = catBoyController;
        activeCamera     = catBoyCamera;
        activeInput      = catBoyInput;

        cat.SetActive(false);
        catFormController.enabled = false;
        catFormCamera.SetActive(false);
        catFormInput.enabled = false;
    }
Пример #3
0
    public static void lockMouse()
    {
        Cursor.lockState = CursorLockMode.Locked;
        GameObject         v   = GameObject.Find("vThirdPersonCamera");
        vThirdPersonCamera cam = v.GetComponent <vThirdPersonCamera>();

        cam.lockCamera = false;

        Invector.CharacterController.vThirdPersonAnimator   a = v.GetComponent <Invector.CharacterController.vThirdPersonAnimator>();
        Invector.CharacterController.vThirdPersonInput      i = v.GetComponent <Invector.CharacterController.vThirdPersonInput>();
        Invector.CharacterController.vThirdPersonController c = v.GetComponent <Invector.CharacterController.vThirdPersonController>();

        //     i.enabled = true;
        //   c.lockMovement = false;
        //   c.enabled = true;
        //   a.enabled = true;

        //i.enabled = true;
        Cursor.lockState = CursorLockMode.Locked;
    }
Пример #4
0
    void OnTriggerEnter(Collider other)
    {
        // for paladin
        if (other.gameObject.CompareTag("Player"))
        {
            if (pc.isKicking)
            {
                playerCtrl = other.transform.GetComponent <Invector.CharacterController.vThirdPersonController>();

                if (!playerCtrl.isAttacked)
                {
                    CameraShaker.Instance.ShakeOnce(3f, 4f, 0.1f, 1f);
                    playerCtrl.isAttacked = true;
                    playerCtrl.isBlocking = false;
                    playerCtrl.animator.SetBool("IsBlocking", false);
                    StartCoroutine(SetFixedForPlayer());
                }
            }
        }
    }
Пример #5
0
    void OnTriggerEnter(Collider other)
    {
        // for paladin
        if (other.gameObject.CompareTag("Player"))
        {
            if (pc.isAttacking)
            {
                playerCtrl = other.transform.GetComponent <Invector.CharacterController.vThirdPersonController>();


                if (interactable && !pc.isAttacked)
                {
                    CameraShaker.Instance.ShakeOnce(4f, 4f, 0.1f, 1f);

                    if (!playerCtrl.isAttacked && !playerCtrl.isBlocking) // player receives attack with weapon
                    {
                        playerCtrl.isAttacked = true;
                        playerCtrl.isKicked   = true;
                        //BloodEffect(other.transform);
                        HotParticleEffect(other.transform);
                        has.RandomizeSfx(hitBodyClips);

                        StartCoroutine(SetFixedForPlayer());


                        // slash sound effect
                    }
                    else if (!playerCtrl.isAttacked && playerCtrl.isBlocking)
                    {
                        has.RandomizeSfx(hitSwordClips);
                        HotParticleEffect(other.transform);
                    }
                    interactable = false;
                    StartCoroutine(SetFixed());
                }
            }
        }
    }
Пример #6
0
    public static void unlockMouse()
    {
        GameObject         v   = GameObject.Find("vThirdPersonController");
        vThirdPersonCamera cam = v.GetComponent <vThirdPersonCamera>();

        cam.lockCamera = true;

        /*Invector.CharacterController.vThirdPersonInput i = v.GetComponent<Invector.CharacterController.vThirdPersonInput>();
         * Invector.CharacterController.vThirdPersonController c = v.GetComponent<Invector.CharacterController.vThirdPersonController>();
         * c.enabled = false;
         * i.enabled = false;*/

        Invector.CharacterController.vThirdPersonAnimator   a = v.GetComponent <Invector.CharacterController.vThirdPersonAnimator>();
        Invector.CharacterController.vThirdPersonInput      i = v.GetComponent <Invector.CharacterController.vThirdPersonInput>();
        Invector.CharacterController.vThirdPersonController c = v.GetComponent <Invector.CharacterController.vThirdPersonController>();
        //     c.lockMovement = true;
        //c.enabled = false;
        //    a.enabled = false;
        // i.enabled = false;
        //i.enabled = false;
        Cursor.lockState = CursorLockMode.None;
        c.keepDirection  = false;
    }
Пример #7
0
        protected vThirdPersonController cc; // access the ThirdPersonController component

        void Start()
        {
            animator = GetComponent <Animator>();
            cc       = GetComponent <vThirdPersonController>();
        }
Пример #8
0
        protected vThirdPersonController cc;                        // access the ThirdPersonController component

        // Use this for initialization√
        void Start()
        {
            cc = gameObject.transform.parent.GetComponent <vThirdPersonController>();
        }