예제 #1
0
            private void OnCollisionEnter(Collision col)
            {
                BaseSpawnable spawnable = col.transform.GetComponent <BaseSpawnable>();

                if (spawnable != null)
                {
                    onHit(spawnable);
                }
            }
예제 #2
0
 public void onSpawnReady(int spawnAmount)
 {
     for (int spawnCounter = 0; spawnCounter <= spawnAmount; spawnCounter++)
     {
         Vector3       spawnablePosition = modelCamera.ViewportToWorldPoint(new Vector3(Random.value, Random.value, Random.Range(100, maxSpawnDistance)));
         Vector3       movementDirection = (playerController.transform.position - spawnablePosition).normalized;
         BaseSpawnable spawnable         = Transform.Instantiate(this, spawnablePosition, Quaternion.identity, spawnerParent.transform);
         spawnable.onSpawn(Random.value * maxMovementSpeed, movementDirection);
     }
 }
예제 #3
0
 public void onHit(BaseSpawnable spawnable)
 {
     statData.triggerStatChange(spawnable.Stat, spawnable.Impact);
 }