예제 #1
0
    void OnTriggerStay(Collider col)
    {
        PhysicalBodyLocal physicalBody = col.GetComponent <PhysicalBodyLocal>();

        if (physicalBody)
        {
            physicalBody.StartSwimming();
        }
        PhysicalBodyWithoutNetworking nonNetwork = col.GetComponent <PhysicalBodyWithoutNetworking>();

        if (nonNetwork)
        {
            nonNetwork.StartSwimming();
        }
    }
예제 #2
0
    void Update()
    {
        #region Camera Fixes
        if (!isLocalPlayer)
        {
            return;
        }

        Cursor.lockState = CursorLockMode.None;
        Cursor.visible   = true;

        if (EchoManage == null)
        {
            GameObject echo = GameObject.Find("EchoManager");
            if (echo != null)
            {
                EchoManage = echo;
            }
        }

        if (physicalBody == null)
        {
            GameObject newBod = GameObject.Find("PhysicalBody_working(Clone)");
            if (newBod != null)
            {
                physicalBody = newBod.GetComponent <PhysicalBodyLocal>();
            }
        }

        if (followingCamera == null)
        {
            GameObject newSpiritCam = GameObject.Find("SpiritualCamera");
            if (newSpiritCam != null)
            {
                followingCamera = newSpiritCam;
                followingCamera.transform.parent = physicalBody.transform;
            }
        }

        if (otherCamera == null)
        {
            GameObject newCam = GameObject.Find("PhysicalCamera");
            if (newCam != null)
            {
                otherCamera = newCam;
                otherCamera.transform.parent = physicalBody.transform;
            }
        }

        followingCamera.SetActive(true);
        otherCamera.SetActive(false);
        #endregion


        //Debug.Log("TransformPosition: " + transform.position);
        //Debug.Log("Physical Position: " + physicalBody.transform.position);

        //Debug.Log("TransformPosition: " + transform.position);

        if (physicalBody != null)
        {
            this.transform.rotation = physicalBody.transform.rotation;
            transform.position      = physicalBody.transform.position;
            physicalBody.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;
        }

        UpdateIsAttacking();
        UpdateAttack();
    }