private void Update()
 {
     if (Input.GetKeyDown(KeyCode.W))
     {
         Manager_Events.Publish(Manager_Events.onWPress, new WPressEvent());
     }
 }
Example #2
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.S))
        {
            float   x   = Random.Range(0, 10);
            float   z   = Random.Range(0, 10);
            Vector3 pos = new Vector3(x, 0, z);

            Instantiate(prefabExample, pos, Quaternion.identity);
            Manager_Events.Publish(Manager_Events.onCubeSpawn, new CubeSpawnEvent(Time.realtimeSinceStartup, pos));
        }
    }
Example #3
0
 private void OnEnable()
 {
     Manager_Events.AddListener(Manager_Events.onWPress, OnWPress);
     Manager_Events.AddListener(Manager_Events.onCubeSpawn, OnCubeSpawn);
 }
Example #4
0
 private void OnDisable()
 {
     Manager_Events.RemoveListener(Manager_Events.onWPress, OnWPress);
     Manager_Events.RemoveListener(Manager_Events.onCubeSpawn, OnCubeSpawn);
 }