Пример #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;
                }
            }
        }
        private void Start()
        {
            button               = GetComponentInParent <Button>();
            inputButton          = button.GetComponent <InputButton>();
            trayInputButton      = button.GetComponent <TrayInputButton>();
            interactButtonToggle = GetComponent <InteractButtonToggle>();
            tooltipButton        = button.gameObject.AddComponent <TooltipInputButton>();
            PropUser component = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject.GetComponent <PropUser>();
            Prop     prop      = component.Prop;

            if (prop != null)
            {
                propValidator = prop.GetComponent <PropValidateDeployLocation>();
                if (propValidator != null)
                {
                    validator = propValidator.GetValidator();
                    if (validator == null)
                    {
                        propValidator.OnValidatorSpawned += onValidatorSpawned;
                    }
                    else
                    {
                        onValidPositionChanged(validator.IsValidPosition);
                        validator.OnValidPositionChanged += onValidPositionChanged;
                    }
                }
            }
            Content.LoadAsync(onTooltipLoaded, TooltipPrefab);
        }