private void Start() { GetDistances(); Timing.RunCoroutine(_UpdateGroundTilePositions()); foreach (var tile in groundTileDistances) { onGroundTileChangedPosition.Raise(tile.Key.position); } }
public override void OnInspectorGUI() { Vector3Event script = (Vector3Event)target; //Event Description GUILayout.BeginVertical(); EditorGUILayout.LabelField("Event Description", EditorStyles.centeredGreyMiniLabel); EditorStyles.textField.wordWrap = true; script.EventDescription = EditorGUILayout.TextArea(script.EventDescription, GUILayout.MinHeight(100)); GUILayout.EndVertical(); //Test Event Button GUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.LabelField("Test Event", EditorStyles.centeredGreyMiniLabel); value = EditorGUILayout.Vector3Field("Value ", value); if (GUILayout.Button("Raise")) { if (Application.isPlaying) { script.Raise(value); } } GUILayout.EndVertical(); }
protected override void OnEnterState() { onPlayPoof.Raise(transform.position); gameObject.SetActive(false); coroutine = Timing.RunCoroutine(WaitAtHomeThenFollowBall()); carryingPieceScript.EnemyIsCarryingAPiece = false; }
void FixedUpdate() { if (!pSystem.IsAlive()) { laserEvent.Raise(transform.localPosition); Destroy(this.gameObject); } }
/// <summary> /// Raises the Onselect event /// </summary> public void OnSelected() { if (!CanBeSelected) { return; } //Sends current position to Vector3EventListeners vector3Event.Raise(this.transform.position); }
public void Dig() { // if (!CanDig) return; DigCircle(); UpdateHitMeshCollider(); if (_groundDugEvent != null) { _groundDugEvent.Raise(HitVertexPosition); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); _invokeValue = EditorGUILayout.Vector3Field("Invoke value", _invokeValue); var buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.fontSize = 32; if (GUILayout.Button("Raise", buttonStyle, _buttonHeight)) { _target.Raise(_invokeValue); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); GUI.enabled = Application.isPlaying; Vector3Event e = target as Vector3Event; if (GUILayout.Button("Raise")) { e.Raise(value); } }
//void SpawnLaserOLDER() //{ // Vector3 spawnPos = new Vector3(Random.Range(-spawnZone.x, spawnZone.x) + uiOffset, spawnZone.y, spawnZone.z); // //Instantiate(LaserWarnPrefab, spawnPos, Quaternion.identity); // Instantiate(LaserPrefab, spawnPos, Quaternion.identity); // Invoke("SpawnLaserOLDER", 1f / spawnPerSec); //} //void SpawnWarningOLD() //{ // Vector3 spawnPos = new Vector3(Random.Range(-spawnZone.x, spawnZone.x) + uiOffset, spawnZone.y, spawnZone.z); // Instantiate(LaserWarnPrefab, spawnPos, Quaternion.identity); // Invoke("SpawnWarningOLD", 1f / spawnPerSec); //} //void SpawnWarning3() //{ // Vector3 spawnPos = new Vector3(Random.Range(-spawnZone.x, spawnZone.x) + uiOffset, player.transform.position.y + playerOffset, spawnZone.z); // Instantiate(LaserWarnPrefab, spawnPos, Quaternion.identity); // // minimum of 1.5 seconds for 0 distance // // want about 10 seconds for distance 400 // Invoke("SpawnWarning3", (enemy.dist + 75) / 50); //} void SpawnWarning() { float spread = Mathf.Clamp(enemy.dist / accFalloff, minAccSpread, maxAccSpread); Vector3 spawnPos = new Vector3( player.transform.position.x + Random.Range(-spread, spread), 0, 10); warningEvent.Raise(spawnPos); //Instantiate(LaserWarnPrefab, spawnPos, Quaternion.identity); // minimum of 1.5 seconds for 0 distance // want about 10 seconds for distance 400 Invoke("SpawnWarning", (enemy.dist + 50) / 75); }
public void ShootLaser(Vector3 position) { laserWarnEvent.Raise(position); }
public void Move(Vector3 _input) { rb.MovePosition( transform.position + _input.normalized * movementSpeed.value * Time.deltaTime); onPlayerMoveEvent.Raise(rb.position); }
// Raise a tp event in Start to center camera AFTER it has been instantiated private void Start() { onPlayerTeleportEvent.Raise(rb.position); }
private void Start() { SpawnNew(0); setPlayerPos.Raise(startPos.transform.position); }