// Update the static accessors. private void OnValidate() { ShowLayout = showLayout; ShowJunctions = showJunctions; NodeRadius = nodeRadius; FloorColor = floorColor; ClimbableColor = climbableColor; if (showJunctions) { PathingNetwork network = GetComponent <PathingNetwork>(); network.PreCalculate(); intersections = network.Intersections; } }
void SpawnEnemy(int size, PathingNetwork network) { var enemy = Instantiate(enemyPrefab, network.Nodes[0].position + Vector3.up, Quaternion.LookRotation(network.Nodes[1].position, Vector3.up)); enemy.GetComponent <Rigidbody>().AddForce(Vector3.up * 2f, ForceMode.VelocityChange); var enemyScript = enemy.GetComponent <Enemy>(); enemyScript.PathingNetwork = network; enemyScript.BuildSystem = buildSystem; if (size == 2) { enemyScript.MakeLarge(); } else if (size == 3) { enemyScript.MakeGiant(); } }