Esempio n. 1
0
 private void Start()
 {
     if (background)
     {
         backgroundObject = @object.GetComponent <BackgroundBehaviour>();
     }
     else
     {
         platform = @object.GetComponent <Platform>();
     }
 }
Esempio n. 2
0
    void Start()
    {
        bool isAndroid = (Application.platform == RuntimePlatform.Android);

        animator   = GetComponent <Animator> ();
        controller = GameObject.Find("GameController").GetComponent <GameController> ();
        newPos     = this.gameObject.transform.position;
        newPos.y   = initalYoffset;
        this.gameObject.transform.position = newPos;
        //this.gameObject.transform.position = pos;
        path   = new LinkedList <Vector2> ();
        behave = GameObject.Find("World").GetComponent <BackgroundBehaviour> ();
        line   = this.gameObject.GetComponentInChildren <LineRenderer> ();
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        BGB1 = BG1.GetComponent <BackgroundBehaviour>();
        BGB2 = BG2.GetComponent <BackgroundBehaviour>();

        fadOut = false;
        fadIn  = false;

        alphaOut = 1f;
        alphaIn  = 0f;

        setBGTex(BGB1);
        setBGTex(BGB2);

        InvokeRepeating("setFadeOut", 0f, switchTime);
        InvokeRepeating("setFadeIn", switchTime / 2f, switchTime);
    }
Esempio n. 4
0
    IEnumerator LoadPlayerData()
    {
        gameoverUI           = FindObjectOfType <GameOverUI>();
        backgroundController = FindObjectOfType <BackgroundBehaviour>();
        changeWaveUI         = FindObjectOfType <ChangeWaveUI>();
        lineRenderer.GetComponent <MouseMovement>().StreakUIController = FindObjectOfType <StreakUIController>();
        lineRenderer.GetComponent <MouseMovement>().mirrorLine.GetComponent <MirrorLineColliderScript>().streakController = FindObjectOfType <StreakUIController>();
        backgroundController.SetTheme();
        projGenerator.SetCurrentTheme();

        projesKilled     = 0;
        totalProjsKilled = 0;

        print("Loading player from " + Application.persistentDataPath);
        player.LoadPlayer();
        player.ChangeColorDependOnHP();

        curAmountOfProjs = 50; projGenerator.coldown = 1;
        for (int i = 2; i <= player.wave; i++)
        {
            curAmountOfProjs      += projsToAddPerWave + (int)(i * 0.5);
            projGenerator.coldown -= projGenerator.coldown * 0.03f;
        }

        for (int i = 0; i < blocks.Length; i++) //SKYBLOCKS
        {
            blocks[i].CalculateAmountOfHealth(player.wave);
        }
        bonusGenerator.ChangeBonusesDuration(player.wave);

        defendedProjsIndexes = projGenerator.CountDefendedAsteroidsAmount(curAmountOfProjs);
        changeWaveUI.StartCoroutine("ShowChangeWaveAnimation", player.wave);
        changingLevel = true;
        backgroundController.StartCoroutine("BackgroundAppear");
        yield return(new WaitForSeconds(changeWavePauseTime));

        changingLevel = false;
    }
Esempio n. 5
0
 void Start()
 {
     bool isAndroid = (Application.platform == RuntimePlatform.Android);
     animator = GetComponent<Animator> ();
     controller = GameObject.Find ("GameController").GetComponent<GameController> ();
     newPos = this.gameObject.transform.position;
     newPos.y = initalYoffset;
     this.gameObject.transform.position = newPos;
     //this.gameObject.transform.position = pos;
     path = new LinkedList<Vector2> ();
     behave = GameObject.Find ("World").GetComponent<BackgroundBehaviour> ();
     line = this.gameObject.GetComponentInChildren<LineRenderer> ();
 }
Esempio n. 6
0
 void setBGTex(BackgroundBehaviour BG)
 {
     BG.setTexture(BGs[Random.Range(0, BGs.Length)]);
 }