private void AppendName(Mouledoux.Callback.Packet a_packet) { var packet = new Mouledoux.Callback.Packet(); packet.strings = new string[] { gameObject.name + ", " }; object[] data = { packet }; Mouledoux.Components.Mediator.instance.NotifySubscribers("appendbigtext", data); }
public void NotActive() { var packet = new Mouledoux.Callback.Packet(); packet.ints = new int[] { gameObject.GetInstanceID() }; object[] data = { packet }; Mouledoux.Components.Mediator.instance.NotifySubscribers("nolongeractive", data); }
public void IncreaseScore() { var packet = new Mouledoux.Callback.Packet(); packet.floats = new float[] { m_scoreValue }; packet.bools = new bool[] { false }; object[] data = { packet }; Mouledoux.Components.Mediator.instance.NotifySubscribers("incrementcurrentscore", data); }
public void InputDirection(Mouledoux.Callback.Packet packet) { float direction = packet.floats[4] > 0.5f ? packet.floats[4] : 0f; direction += packet.floats[5] < -0.5f ? packet.floats[4] : 0f; transform.RotateAround(transform.position, transform.forward, -direction * 4f); Physics2D.gravity = -transform.up * 10f; }
public void NextRailPoint() { currentPoint++; //TurnOffOtherZones(); if (currentPoint >= railPoints.Count - 1) { currentPoint = railPoints.Count - 1; Mouledoux.Components.Mediator.instance.NotifySubscribers("setreview"); StartTeleport(railPoints[currentPoint]); return; } var pack = new Mouledoux.Callback.Packet(); pack.ints = new int[] { currentPoint }; object[] data = { pack }; Mouledoux.Components.Mediator.instance.NotifySubscribers("teleporting", data); StartTeleport(railPoints[currentPoint]); }
private void InputExternalGravityControl(Mouledoux.Callback.Packet packet) { if (!packet.bools[2] || packet.floats[4] < 0.1f) { return; } if (m_target != null) { m_target = null; return; } RaycastHit2D rayHit = Physics2D.Raycast(transform.position, transform.right); if (rayHit.transform.GetComponent <Rigidbody2D>() == null) { return; } m_target = rayHit.transform.GetComponent <Rigidbody2D>(); }
private void InputGlobalGravity(Mouledoux.Callback.Packet packet) { if (packet.bools[9]) { Utilities.globalGravity = Vector3.zero; return; } else if (packet.floats[4] > 0.1f) { return; } Vector2 rightStick = new Vector2(packet.floats[2], packet.floats[3]); if (rightStick.magnitude > 0.01f) { Utilities.globalGravity += (Vector3) (rightStick * (10f + Utilities.globalGravity.magnitude) * Time.deltaTime); } }
private void GetControllerInput() { leftStick = GetJoystickInput("Left"); rightStick = GetJoystickInput("Right"); leftTrigger = GetTriggerInput("Left"); rightTrigger = GetTriggerInput("Right"); buttonA = Input.GetKeyDown(KeyCode.JoystickButton0); buttonB = Input.GetKeyDown(KeyCode.JoystickButton1); buttonX = Input.GetKeyDown(KeyCode.JoystickButton2); buttonY = Input.GetKeyDown(KeyCode.JoystickButton3); leftBumper = Input.GetKeyDown(KeyCode.JoystickButton4); rightBumper = Input.GetKeyDown(KeyCode.JoystickButton5); rightStickClick = Input.GetKeyDown(KeyCode.JoystickButton9); joysticks[0] = leftStick.x; joysticks[1] = leftStick.y; joysticks[2] = rightStick.x; joysticks[3] = rightStick.y; joysticks[4] = leftTrigger; joysticks[5] = rightTrigger; buttons[0] = buttonA; buttons[1] = buttonB; buttons[2] = buttonX; buttons[3] = buttonY; buttons[4] = leftBumper; buttons[5] = rightBumper; buttons[9] = rightStickClick; Mouledoux.Callback.Packet inputData = new Mouledoux.Callback.Packet(new int[0], buttons, joysticks, new string[0]); Mouledoux.Components.Mediator.instance.NotifySubscribers("input", inputData); }
private void InputMove(Mouledoux.Callback.Packet packet) { Vector2 velocity = Vector2.zero; Vector2 leftStick = new Vector2(packet.floats[0], packet.floats[1]); bool buttonA = packet.bools[0]; bool buttonB = packet.bools[1]; velocity.x += leftStick.x * speed * (m_airborn ? 0.25f : 1f); velocity.y += buttonA && m_jumpsLeft > 0 ? m_jumpStrength : buttonB && m_jumpsLeft > 0 ? -m_jumpStrength * 2f : -1; m_jumpsLeft -= buttonA || buttonB ? 1 : 0; velocity = transform.TransformDirection(velocity); velocity *= Utilities.timeScale; UpdateRigidPhysics(); //m_rigidbody.AddForce(velocity); //m_rigidbody.AddForce(Utilities.globalGravity * Utilities.timeScale); ResetRigidhysics(); }
private void InvokeUnityEvent(Mouledoux.Callback.Packet emptyPacket) { m_event.Invoke(); }
protected void OffInteract(Mouledoux.Callback.Packet packet) { m_offInteract.Invoke(); }
protected void OffHighlight(Mouledoux.Callback.Packet packet) { m_offHighnight.Invoke(); }
public void ScrubAnimation(Mouledoux.Callback.Packet packet) { ScrubAnimation(packet.floats[0]); }
private void InputTime(Mouledoux.Callback.Packet packet) { Utilities.timeScale = (packet.bools[0] ? 0.1f : 1.0f); }
private void InputDirection(Mouledoux.Callback.Packet packet) { Vector2 direction = Camera.main.transform.up.normalized; transform.up = Vector3.Lerp(transform.up, direction, Time.deltaTime * m_speed); }
public void SetFlowRate(Mouledoux.Callback.Packet packet) { SetFlowRate(packet.floats[0]); }