コード例 #1
0
    public void spawnNewGirlPickup(bool putDown)
    {
        CoopSyncGirlPickupToken coopSyncGirlPickupToken = new CoopSyncGirlPickupToken();

        coopSyncGirlPickupToken.putDown      = putDown;
        coopSyncGirlPickupToken.pickup       = false;
        coopSyncGirlPickupToken.playerTarget = base.transform.root.GetComponent <BoltEntity>();
        BoltNetwork.Instantiate(Resources.Load("CutScene/girl_Pickup") as GameObject, coopSyncGirlPickupToken, base.transform.position, base.transform.rotation);
    }
コード例 #2
0
    public override void Attached()
    {
        CoopSyncGirlPickupToken coopSyncGirlPickupToken = (CoopSyncGirlPickupToken)base.entity.attachToken;

        if (!CoopPeerStarter.DedicatedHost && BoltNetwork.isServer && coopSyncGirlPickupToken.playerTarget == LocalPlayer.Entity)
        {
            return;
        }
        girlPickupCoopSync componentInChildren = base.transform.GetComponentInChildren <girlPickupCoopSync>();

        if (coopSyncGirlPickupToken.putDown && componentInChildren)
        {
            componentInChildren.setGirlPutDownAnimation(coopSyncGirlPickupToken.playerTarget.transform);
        }
    }
コード例 #3
0
        public IEnumerator putDownGirlRoutine()
        {
            this.enablePlayerLocked();
            LocalPlayer.Animator.SetBool("girlPickup", false);
            this.currState2 = LocalPlayer.Animator.GetCurrentAnimatorStateInfo(2);
            while (this.currState2.shortNameHash != this.putDownGirlHash)
            {
                this.currState2 = LocalPlayer.Animator.GetCurrentAnimatorStateInfo(2);
                LocalPlayer.Rigidbody.velocity = Vector3.zero;
                LocalPlayer.Animator.SetLayerWeightReflected(3, 0f);
                if (this.currState2.shortNameHash == this.putDownGirlHash)
                {
                    break;
                }
                yield return(null);
            }
            if (BoltNetwork.isClient)
            {
                syncGirlPickup syncGirlPickup = syncGirlPickup.Create(GlobalTargets.Everyone);
                syncGirlPickup.target               = base.transform.root.GetComponent <BoltEntity>();
                syncGirlPickup.playerTarget         = base.transform.root.GetComponent <BoltEntity>();
                syncGirlPickup.spawnGirl            = true;
                syncGirlPickup.syncPutDownAnimation = true;
                syncGirlPickup.Send();
            }
            else
            {
                CoopSyncGirlPickupToken coopSyncGirlPickupToken = new CoopSyncGirlPickupToken();
                coopSyncGirlPickupToken.putDown      = true;
                coopSyncGirlPickupToken.pickup       = false;
                coopSyncGirlPickupToken.playerTarget = base.transform.root.GetComponent <BoltEntity>();
                GameObject gameObject;
                if (BoltNetwork.isRunning)
                {
                    gameObject = BoltNetwork.Instantiate(Resources.Load("CutScene/girl_Pickup") as GameObject, coopSyncGirlPickupToken, LocalPlayer.PlayerBase.transform.position, LocalPlayer.PlayerBase.transform.rotation).gameObject;
                }
                else
                {
                    gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("CutScene/girl_Pickup"), LocalPlayer.PlayerBase.transform.position, LocalPlayer.PlayerBase.transform.rotation);
                }
                Animator componentInChildren = gameObject.GetComponentInChildren <Animator>();
                componentInChildren.enabled = true;
                componentInChildren.CrossFade("Base Layer.putDownGirl", 0f, 0, this.currState2.normalizedTime);
            }
            this.girlHeld.SetActive(false);
            while (this.currState2.shortNameHash == this.putDownGirlHash)
            {
                LocalPlayer.Animator.SetLayerWeightReflected(3, 0f);
                this.currState2 = LocalPlayer.Animator.GetCurrentAnimatorStateInfo(2);
                yield return(null);
            }
            this.disablePlayerLocked();
            LocalPlayer.AnimControl.holdingGirl = false;
            LocalPlayer.Inventory.EquipPreviousWeapon(true);
            LocalPlayer.Inventory.ShowAllEquiped(true);
            float timer = 0f;

            while (timer < 1f)
            {
                LocalPlayer.CamFollowHead.transform.localRotation = Quaternion.Lerp(LocalPlayer.CamFollowHead.transform.localRotation, LocalPlayer.CamFollowHead.transform.parent.localRotation, timer);
                timer += Time.deltaTime * 3f;
                yield return(null);
            }
            yield break;
        }