예제 #1
0
    // Use this for initialization
    void Start()
    {
        _GM                 = GameObject.FindGameObjectWithTag("Stats").GetComponent <StatsLoggerScript>();
        audioManager        = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManagerScript>();
        pos                 = Camera.main.WorldToScreenPoint(transform.position);
        laser               = GetComponentInChildren <LineRenderer>(true);
        lazerParticleSystem = GetComponentInChildren <ParticleSystem>(true);
        laser.enabled       = false;

        CheckKeyBinding();
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     _GM                 = GameObject.FindGameObjectWithTag("Stats").GetComponent <StatsLoggerScript>();
     spawnState          = SpawnState.waiting;
     _GM.startedSpawning = false;
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        _GM          = GameObject.FindGameObjectWithTag("Stats").GetComponent <StatsLoggerScript>();
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManagerScript>();
        spawnSystem  = GameObject.FindGameObjectWithTag("SpawnSystem").GetComponent <SpawnSystemScript>();
        Color lightColor = Color.gray;

        pointLight   = GetComponentInChildren <Light>();
        meshRenderer = GetComponent <MeshRenderer>();
        if (spawnSystem.GetNumOfSpawnedEnemies < numOfOnlyPrimaryColoredEnemies)
        {
            color = (Colors)Random.Range(0, 3);
        }
        else if (spawnSystem.GetNumOfSpawnedEnemies == numOfOnlyPrimaryColoredEnemies)
        {
            color = (Colors)Random.Range(3, 6);
            _GM.firstSecondarySpawned = true;
        }
        else
        {
            color = (Colors)Random.Range(0, 7);
        }

        //Debug.Log("Enemy Color is " + color);

        switch (color)
        {
        case Colors.red:

            hasRed     = true;
            lightColor = Color.red;

            break;

        case Colors.green:

            hasGreen   = true;
            lightColor = Color.green;


            break;

        case Colors.blue:

            hasBlue    = true;
            lightColor = Color.blue;
            break;

        case Colors.yellow:

            hasGreen   = true;
            hasRed     = true;
            lightColor = Color.yellow;

            break;

        case Colors.cyan:

            hasBlue    = true;
            hasGreen   = true;
            lightColor = Color.cyan;

            break;

        case Colors.magenta:

            hasBlue    = true;
            hasRed     = true;
            lightColor = Color.magenta;

            break;

        case Colors.white:

            hasBlue    = true;
            hasRed     = true;
            hasGreen   = true;
            lightColor = Color.white;

            break;

        default:
            break;
        }

        lazerMaterial    = lazerMaterialsRGBYCMW[(int)color];
        particleMaterial = particleMaterialsRGBYCMW[(int)color];
        //Debug.Log("Setting lightcolor to " + lightColor);
        pointLight.color = lightColor;

        meshRenderer.material = lazerMaterial;
    }