Exemple #1
0
    //private bool isLoaded;


    void Awake()
    {
        gm           = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerThing>();
        sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <SceneFlowManager>();
        pidgeon_rb   = this.transform.GetComponent <Rigidbody2D>();
        anim         = this.transform.GetComponentInChildren <Animator>();
    }
Exemple #2
0
    void Awake()
    {
        gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerThing>();


        for (int i = 0; i < targetPositions.Count; i++)
        {
            int randPickUpChance = Random.Range(0, 100);


            GameObject newMailbox   = Instantiate(MailBoxes [0], Vector2.zero, Quaternion.identity) as GameObject;
            Transform  boxTransform = newMailbox.transform;

            if (randPickUpChance >= 65 && gm.collectables <= 2)
            {
                TargetBehaivor targetBehaivor = newMailbox.GetComponent <TargetBehaivor> ();
                targetBehaivor.isPickUp = true;
                boxTransform.GetComponentInChildren <Animator> ().SetTrigger("isPickUp");
            }
            boxTransform.SetParent(targetParent);
            boxTransform.localPosition = targetPositions [i].localPosition;
        }


        groundSpawner = GameObject.FindGameObjectWithTag("GroundSpawner").GetComponent <GroundSpawning>();
        moveSpeed     = groundSpawner.groundMoveSpeedMin;
    }
Exemple #3
0
 void Awake()
 {
     gm  = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerThing>();
     eat = GameObject.FindGameObjectWithTag("EnvAudio").GetComponent <EnvironmentAudioTerminal>();
     //anim = transform.GetComponentInChildren<Animator> ();
     projectile_rb = this.transform.GetComponent <Rigidbody2D> ();
     projectile_rb.AddForce(Vector2.right * dropForceForward, ForceMode2D.Impulse);
 }
Exemple #4
0
    public override void Awake()
    {
        gmt = GameObject.FindObjectOfType <GameManagerThing>();
        if (gmt == null)
        {
            Debug.Log("Shit's on Fire, yo...");
        }

        currentChannel      = audioChannel[0];
        currentChannel.loop = true;
        nextChannel         = audioChannel[1];
        nextChannel.loop    = true;

        currentChannel.clip = intro;
        currentClipLength   = currentChannel.clip.length;
        currentClip         = currentChannel.clip;

        //nextChannel.clip = GetNextClip(currentClip); //rampUp;
        nextChannel.clip = transitionType[0]; //rampUp;
        nextClipLength   = nextChannel.clip.length;
        nextClip         = nextChannel.clip;  //currentChannel.clip;

        base.Awake();
    }
Exemple #5
0
 void Awake()
 {
     gm             = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerThing>();
     spriteRenderer = this.transform.GetComponent <SpriteRenderer> ();
 }