// Update is called once per frame void Update() { var moveAmt = Input.GetAxis("Horizontal") * MOVE_SPEED * Time.deltaTime; if (moveAmt == 0) { this.rend.materials[0].mainTexture = stableShip; } else if (moveAmt > 0) { this.rend.materials[0].mainTexture = rightShip; } else { this.rend.materials[0].mainTexture = leftShip; } var pos = this.trans.position; pos.x += moveAmt; this.trans.position = pos; if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)) { var spawnPos = this.trans.position; spawnPos.z += 15; if (!string.IsNullOrEmpty(customEventName) && LevelSettings.CustomEventExists(customEventName)) { LevelSettings.FireCustomEvent(customEventName, this.trans); } PoolBoss.SpawnOutsidePool(ProjectilePrefab.transform, spawnPos, ProjectilePrefab.transform.rotation); } }
public void CheckForIllegalCustomEvents() { if (CustomEvent != LevelSettings.NoEventName && !LevelSettings.CustomEventExists(CustomEvent)) { LevelSettings.LogIfNew("Transform '" + name + "' is set up to receive or fire Custom Event '" + CustomEvent + "', which does not exist in Core GameKit."); } }