示例#1
0
 void Start()
 {
     SpaceInvaders.SetDefault();
     if (SpaceInvaders.drawBackground)
     {
         background = Instantiate(background);
         StartCoroutine(SpriteChanger());
     }
 }
    void Start()
    {
        SpaceInvaders.SetDefault();
        if (SpaceInvaders.lightingEffects)
        {
            block.GetComponent <SpriteRenderer>().material = lightingMaterial;
        }
        else
        {
            block.GetComponent <SpriteRenderer>().material = noLightingMaterial;
        }
        randomAppearing = new System.Random();
        float x = -6.6F, y = -2.25F;

        for (int k = 0; k < 4; k++)
        {
            for (int i = 0; i < 14; i++)
            {
                for (int j = 0; j < 20; j++)
                {
                    if (shelter[i, j] > 0)
                    {
                        GameObject thisBlock = Instantiate(block, new Vector3(x, y, 0), Quaternion.identity);
                        if (shelter[i, j] == 2 && SpaceInvaders.lightingEffects)
                        {
                            GameObject light = new GameObject("Light");
                            light.transform.SetParent(thisBlock.transform);
                            light.transform.position = thisBlock.transform.position + new Vector3(0, 0, -0.32F);
                            Light svet = light.AddComponent <Light>();
                            svet.range     = 5F;
                            svet.intensity = 0.8F;
                            svet.color     = new Color(0.133F, 0.694F, 0.298F, 1);

                            thisBlock.AddComponent <LightingShelter>();
                        }
                    }
                    x += 0.075F;
                }
                y -= 0.075F;
                x -= 20 * 0.075F;
            }
            x += 3.9F;
            y  = -2.25F;
        }
    }
示例#3
0
    void Start()
    {
        SpaceInvaders.SetDefault();
        if (SpaceInvaders.lightingEffects)
        {
            alien.GetComponent <SpriteRenderer>().material = lightingMaterial;
        }
        else
        {
            alien.GetComponent <SpriteRenderer>().material = noLightingMaterial;
        }

        moveDownAtStartAmount = 16 + SpaceInvaders.level;
        speed = 1;
        InstantiateAliens();
        DelayBetweenMoves = 0.01F;
        direction         = 1;
        time            = 0;
        countingAllowed = true;
        a = new System.Random();
        bulletSpawnTime = a.Next(2, 9) / 10F;
    }
 public void CallSettings()
 {
     SceneManager.LoadSceneAsync("Settings Menu");
     SpaceInvaders.SetDefault();
 }