Exemplo n.º 1
0
    private void SpawnHazard(GameObject hazardToSpawn, float xPosition, HazardConfig config)
    {
        Vector3    spawnPosition = new Vector3(xPosition, spawnValues.y, spawnValues.z);
        Quaternion spawnRotation = Quaternion.identity;

        Instantiate(hazardToSpawn, spawnPosition, spawnRotation);
    }
Exemplo n.º 2
0
    private void SpawnAngleHazard(GameObject hazardToSpawn, float xPosition, float angle, float zOffset, HazardConfig config)
    {
        Vector3          spawnPosition = new Vector3(xPosition, spawnValues.y, spawnValues.z + zOffset);
        Quaternion       spawnRotation = Quaternion.Euler(0, angle, 0);
        GameObject       hazard        = Instantiate(hazardToSpawn, spawnPosition, spawnRotation) as GameObject;
        MoveObjectByPath script        = hazard.AddComponent <MoveObjectByPath> () as MoveObjectByPath;

        script.pathName = "FromLeft";
        script.time     = 20;
    }