Exemplo n.º 1
0
        public void OnPropRetrieveCompleted()
        {
            if (PlayerHandle.IsNull)
            {
                return;
            }
            isPropAnimCompleted = true;
            checkRetrieveCompleted();
            HeldObjectsData component = dataEntityCollection.GetComponent <HeldObjectsData>(PlayerHandle);

            if (component != null && component.HeldObject != null)
            {
                HeldObjectType objectType = component.HeldObject.ObjectType;
                if (objectType == HeldObjectType.DURABLE && Prop != null)
                {
                    InteractiveZonePropEventHandler component2 = Prop.GetComponent <InteractiveZonePropEventHandler>();
                    if (component2 != null)
                    {
                        UnityEngine.Object.Destroy(component2);
                    }
                }
            }
            if (Prop != null && Prop.IsOwnerLocalPlayer)
            {
                ParticipationData component3 = dataEntityCollection.GetComponent <ParticipationData>(dataEntityCollection.LocalPlayerHandle);
                if (component3 != null)
                {
                    component3.IsInteractButtonAvailable = true;
                }
            }
        }
Exemplo n.º 2
0
        private bool onHeldObjectEquipped(long sessionId, string objectId, HeldObjectType type)
        {
            if (isLocalPlayer(sessionId) && type != HeldObjectType.PARTYGAME)
            {
                return(false);
            }
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntity <SessionIdData, long>(sessionId);

            if (!dataEntityHandle.IsNull && dataEntityCollection.HasComponent <HeldObjectsData>(dataEntityHandle))
            {
                DHeldObject dHeldObject = new DHeldObject();
                dHeldObject.ObjectId   = objectId;
                dHeldObject.ObjectType = type;
                dataEntityCollection.GetComponent <HeldObjectsData>(dataEntityHandle).HeldObject = dHeldObject;
            }
            return(false);
        }
Exemplo n.º 3
0
    public void SetupMode()
    {
        manager.mode.SoftUnload();
        manager.mode = instance;

        manager.mainPointer.GetComponent <Renderer>().enabled = false;

        if (WorldBuilderMain.selectedObject.GetComponentInChildren <MRWChat>())
        {
            hot = HeldObjectType.Chat;
        }
        else if (WorldBuilderMain.selectedObject.GetComponentInChildren <MRWPose>())
        {
            hot = HeldObjectType.Poseable;
            manager.controlList.text = Globals.PLACE_CONTROL_2;
        }
        else
        {
            hot = HeldObjectType.Normal;
            manager.controlList.text = Globals.PLACE_CONTROL;
        }
    }
Exemplo n.º 4
0
    private void Throw()
    {
        audioSource.clip = throwClip;
        audioSource.Play();
        if (heldObjectType == HeldObjectType.Lure)
        {
            GameObject oldLure = GameObject.Find("Lure");
            if (oldLure != null)
            {
                Destroy(oldLure);
            }
            Transform lureTrans = ((GameObject)Instantiate(lurePrefab)).transform;
            lureTrans.name = "Lure";
            if (releasePosition == null)
            {
                lureTrans.position = transform.position;
            }
            else
            {
                lureTrans.position = releasePosition.position;
            }

            Rigidbody2D lureBody = lureTrans.GetComponent <Rigidbody2D> ();
            lureBody.velocity     = (GetThrowVelocity() * throwSpeed) + new Vector2(rb2d.velocity.x, 0f);
            lureBody.gravityScale = Mathf.Abs((gravity * throwSpeed * throwSpeed) / Physics.gravity.y);
        }
        else
        {
            heldObjectType  = HeldObjectType.Lure;
            creature.parent = null;
            Rigidbody2D creatureRB = creature.GetComponent <Rigidbody2D> ();
            creatureRB.isKinematic  = false;
            creatureRB.velocity     = (GetThrowVelocity() * throwSpeed) + new Vector2(rb2d.velocity.x, 0f);
            creatureRB.gravityScale = Mathf.Abs((gravity * throwSpeed * throwSpeed) / Physics.gravity.y);
        }
    }