public void ObjectState(EInteractiveObjectState p_state, Boolean p_setup) { StopAllCoroutines(); if (p_state == EInteractiveObjectState.ON) { if (p_setup) { if (m_StatueObject != null && m_InitialPosition != null && m_TargetPosition != null) { m_StatueObject.transform.position = m_TargetPosition.position; m_StatueObject.transform.localRotation = m_TargetPosition.localRotation; } if (m_targetLight != null) { m_targetLight.enabled = true; } if (m_targetEffect != null) { m_targetEffect.Play(true); } } else { enabled = true; mTimer = 0f; AudioManager.Instance.RequestPlayAudioID(m_activateSound, 0, -1f, transform, m_soundVolume, 0f, 0f, null); } } else { InitializeStartSetup(); AudioController.Stop(m_activateSound); } }
private Int32 StateToInt(EInteractiveObjectState p_state) { switch (p_state) { case EInteractiveObjectState.COUNTER_1: return(1); case EInteractiveObjectState.COUNTER_2: return(2); case EInteractiveObjectState.COUNTER_3: return(3); case EInteractiveObjectState.COUNTER_4: return(4); case EInteractiveObjectState.COUNTER_5: return(5); case EInteractiveObjectState.COUNTER_6: return(6); case EInteractiveObjectState.COUNTER_7: return(7); case EInteractiveObjectState.COUNTER_8: return(8); case EInteractiveObjectState.COUNTER_9: return(9); default: return(1); } }
public void ObjectState(EInteractiveObjectState p_stateValue, Boolean p_animate) { if (AudioController.DoesInstanceExist()) { AudioController.Stop(m_doorOpenSoundID); } if (p_stateValue != EInteractiveObjectState.DOOR_OPEN) { if (p_stateValue == EInteractiveObjectState.DOOR_CLOSED) { ChangeActiveState(m_OpenObject, false); ChangeActiveState(m_ClosedObject, true); ChangeActiveState(m_OpenEffect, false); Invoke("InvokeTriggerStateChange", 0f); } } else { ChangeActiveState(m_OpenObject, true); ChangeActiveState(m_ClosedObject, false); if (p_animate) { ChangeActiveState(m_OpenEffect, true); if (AudioController.DoesInstanceExist()) { AudioController.Play(m_doorOpenSoundID, transform, m_soundVolume, 0f, 0f); } } Invoke("InvokeTriggerStateChange", m_triggerStateChangeTime); } }
public void ObjectState(EInteractiveObjectState p_stateValue, Boolean p_skipAnimation) { switch (p_stateValue) { default: Invoke("Close", 0f); break; case EInteractiveObjectState.BARREL_OPEN: if (!p_skipAnimation) { AudioManager.Instance.RequestPlayAudioID(m_openSound, 1, -1f, transform, m_soundVolume, 0f, 0f, null); SpawnEffect(m_openEffect); SpawnEffect(m_openParticleEffect); } Invoke("Open", (!p_skipAnimation) ? m_openDelay : 0f); break; case EInteractiveObjectState.BARREL_EMPTY: if (!p_skipAnimation) { AudioManager.Instance.RequestPlayAudioID(m_drinkSound, 1, -1f, transform, m_soundVolume, 0f, 0f, null); SpawnEffect(m_drinkEffect); SpawnEffect(m_drinkParticleEffect); } Invoke("Drink", (!p_skipAnimation) ? m_drinkDelay : 0f); break; } }
public void ObjectState(EInteractiveObjectState p_state, Boolean p_skipAnimation) { AudioController.Stop(m_useSound); AudioController.Stop(m_isReadySound); if (!p_skipAnimation) { AudioManager.Instance.RequestPlayAudioID((p_state != EInteractiveObjectState.OFF) ? m_isReadySound : m_useSound, 1, -1f, transform, m_soundVolume, 0f, 0f, null); } }
private void OnCounterChanged(EInteractiveObjectState p_state) { if (p_state == m_activeState) { Invoke("Activate", m_activateDelay); } else { Invoke("Deactivate", m_activateDelay); } }
private void OnCounterChanged(EInteractiveObjectState p_state) { if (p_state == m_activeState) { animation.Play(m_activate.name); } else { animation.Play(m_deactivate.name); } }
public void ObjectState(EInteractiveObjectState p_state) { StopAllCoroutines(); if (p_state == EInteractiveObjectState.BUTTON_DOWN) { StartCoroutine(PlayAudioSequence()); } else { AudioController.Stop(m_knockSound); AudioController.Stop(m_InmateSound); } }
public void ObjectState(EInteractiveObjectState p_state, Boolean p_isSetup) { if (p_state == m_playOnState) { if (!p_isSetup || m_playOnInit) { AudioManager.Instance.RequestPlayAudioID(m_Sound, 0, -1f, transform, m_soundVolume, 0f, 0f, null); } } else { AudioController.Stop(m_Sound); } }
public void ObjectState(EInteractiveObjectState p_state) { if (p_state == m_reactOnState) { if (mParticles != null) { mParticles.Play(true); } } else if (mParticles != null) { mParticles.Stop(true); } }
public void ObjectState(EInteractiveObjectState p_state) { if (p_state == m_reactOnState) { if (animation != null && animation.GetClip(m_ActivateClip) != null) { animation.Play(m_ActivateClip, PlayMode.StopAll); } } else if (animation != null && animation.GetClip(m_DeactiveClip) != null) { animation.Play(m_DeactiveClip, PlayMode.StopAll); } }
public void ObjectState(EInteractiveObjectState p_state, Boolean p_instantSet) { if (p_state != EInteractiveObjectState.ON) { if (p_state == EInteractiveObjectState.OFF) { Invoke("Deactivate", (!p_instantSet) ? m_delay : 0f); } } else { Invoke("Activate", (!p_instantSet) ? m_delay : 0f); } }
protected override void ParseExtra(String p_extra) { String[] array = p_extra.Split(new Char[] { ',' }); if (array.Length != 1) { throw new FormatException(String.Concat(new Object[] { "Could not parse interaction params '", p_extra, "' because it contains ", array.Length, " arguments instead of ", 1 })); } m_newState = (EInteractiveObjectState)Enum.Parse(typeof(EInteractiveObjectState), array[0]); }
protected override void DoExecute() { LegacyLogic.Instance.WorldManager.QuickSaveAllowed = false; SetStates(); if (!String.IsNullOrEmpty(m_targetDoor.Prefab)) { if (!m_targetDoor.InteractLock) { m_targetDoor.InteractLock = true; EInteractiveObjectState p_targetState = TargetDoorState(); m_targetDoor.UpdateNextState(p_targetState); DoorEntityEventArgs p_eventArgs = new DoorEntityEventArgs(m_targetDoor, true, p_targetState); LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.DOOR_STATE_CHANGED, p_eventArgs); } } else { TriggerStateChange(); } FinishExecution(); }
public override void SetData(EInteractiveObjectData p_key, String p_value) { if (p_key == EInteractiveObjectData.CONDITIONAL_DATA) { String[] array = p_value.Split(new Char[] { ',' }); Int32 id = Convert.ToInt32(array[0]); if (Enum.IsDefined(typeof(EInteractiveObjectState), array[1])) { EInteractiveObjectState wantedState = (EInteractiveObjectState)Enum.Parse(typeof(EInteractiveObjectState), array[1]); ObjectCondition item; item.id = id; item.wantedState = wantedState; m_conditions.Add(item); } } else { base.SetData(p_key, p_value); } }
public DoorEntityEventArgs(Door p_object, Boolean p_animate, EInteractiveObjectState p_targetState) : base(p_object, p_object.Position) { Animate = p_animate; TargetState = p_targetState; }
public Button(Int32 p_staticID, Int32 p_spawnerID) : base(p_staticID, EObjectType.BUTTON, p_spawnerID) { m_State = EInteractiveObjectState.BUTTON_UP; }
protected Button(Int32 p_staticID, EObjectType p_objectType, Int32 p_spawnerID) : base(p_staticID, p_objectType, p_spawnerID) { m_State = EInteractiveObjectState.BUTTON_UP; }