// Use this for initialization
    void Start()
    {
        currentLayer = LayerMask.NameToLayer("Players");
        invLayer     = LayerMask.NameToLayer("Invulnerable");

        fireCooldown = 1f;
        curammo      = ammo;

        distance       = new Vector3(2, 0, 0);
        shieldDistance = new Vector3(0.5f, 0, 0);
        bulletDistance = new Vector3(1.75f, 0, 0);
        dashDistance   = new Vector3(3, 0, 0);
        thisTransform  = transform;
        startPos       = thisTransform.position;
        //aimer = FindObjectOfType(GameObject);
        aimer   = Instantiate(aimer, thisTransform.position + distance, Quaternion.identity) as GameObject;
        p1score = GameObject.Find("P1 Score").GetComponent <P1ScoreKeeper>();

        mpc     = GameObject.Find("Player 1(Clone)").GetComponent <MyPlayerController>();
        handler = GameObject.Find("EventHandler").GetComponent <EventHandler>();
        P2Ammo  = GameObject.Find("P2 Ammo").GetComponent <P2AmmoKeeper>();

        playerCol = this.GetComponent <Collider2D>();

        sr = this.GetComponent <SpriteRenderer>();
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        P1Ammo = GameObject.Find("P1 Ammo").GetComponent <P1AmmoKeeper>();
        P2Ammo = GameObject.Find("P2 Ammo").GetComponent <P2AmmoKeeper>();

        p1Spawn = GameObject.Find("P1Spawn");
        p2Spawn = GameObject.Find("P2Spawn");

        Banner = GameObject.Find("Banner");
        bc     = Banner.GetComponent <BannerController>();
        //bc.ShowBanner();


/*		p1 = Instantiate(player1, p1Spawn.transform.position, Quaternion.identity) as GameObject;
 *              p2 = Instantiate(player2, p2Spawn.transform.position, Quaternion.identity) as GameObject;*/
        spawned = false;

        p1 = GameObject.Find("Player 1(Clone)");
        p2 = GameObject.Find("Player 2(Clone)");
    }