void Awake() { m_subCallback = InvokeUnityEvent; if (isZone) { var message = GetComponent <ScoreManager>().Message; var subString = message.Substring(4, 1); int sum; if (int.TryParse(subString, out sum)) { m_subMessage = "Zone" + (sum - 1) + " Complete"; } } m_subscriptions.Subscribe(m_subMessage, m_subCallback); gameObject.SetActive(setActive); }
// ---------- ---------- ---------- ---------- ---------- private void Start() { if (objectRef == null) { objectRef = gameObject; } objectRef.transform.position = railPoints[currentPoint].position; originalPos = objectRef.transform.localPosition; originalRot = objectRef.transform.localRotation; StartCoroutine(FadeInOut()); TurnOffOtherZones(); nextRailHandler += NextRailPoint; m_subscriptions.Subscribe("MoveToNextRailPoint", nextRailHandler); }
public void Initialize(string a_keyboardID, string a_mainString, string a_shiftString = "", bool a_capsShift = true) { m_keyboardID = a_keyboardID; m_mainKey = a_mainString.ToLower(); //m_shiftKey = a_shiftString == "" ? m_mainKey.ToUpper() : a_shiftString; m_onHighnight.AddListener(delegate { SetMaterial(m_highlightMat); m_alreadySent = false; m_hoverNoise.Play(); }); m_offHighnight.AddListener(delegate { SetMaterial(m_normalMat); m_alreadySent = false; }); m_onInteract.AddListener(delegate { PressKey(); }); m_offInteract.AddListener(delegate { m_alreadySent = false; }); onShift = null; onKeyPress = null; m_subscriptions.UnsubscribeAll(); onKeyPress += ShiftKey; m_subscriptions.Subscribe($"vrkeyboard:{m_keyboardID}", onKeyPress); DefaultKey(); ResetMaterial(); }
void Awake() { m_onChangeCurrent += ChangeCurrent; m_subscriptions.Subscribe("newslingactive", m_onChangeCurrent); }
private void Start() { OnInput += InputDirection; m_subscriptions.Subscribe("input", OnInput); }