예제 #1
0
    public Machinegun(int x, int y)
    {
        Turret.transform.position = new Vector2(x, y);

        TurretBase.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("TurretBase");
        TurretGun.GetComponent <SpriteRenderer>().sprite  = Resources.Load <Sprite>("TurretGun");

        Cost = 70;
        TurretGun.AddComponent <MachinegunScript>();
    }
예제 #2
0
    public Slowtower(int x, int y)
    {
        Turret.name  = "SlowTower";
        Turret.layer = LayerMask.NameToLayer("Tower");
        Turret.transform.position = new Vector2(x, y);

        TurretGun.AddComponent <CircleCollider2D>().isTrigger = true;
        TurretGun.GetComponent <CircleCollider2D>().radius    = 2f;

        Debug.Log(LayerMask.NameToLayer("Slowarea"));
        TurretGun.layer = LayerMask.NameToLayer("Slowarea");
        TurretBase.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("TurretBase");
        TurretGun.GetComponent <SpriteRenderer>().sprite  = Resources.Load <Sprite>("Slowturret");

        Cost = 100;
        TurretGun.AddComponent <SlowtowerScript>();
    }
예제 #3
0
    public Laserbeam(int x, int y)
    {
        Turret.name    = "Laserbeam";
        TurretGun.name = "Laserbeam";

        Turret.transform.position = new Vector2(x, y);

        TurretGun.AddComponent <LineRenderer>().material   = Resources.Load <Material>("laser");
        TurretGun.GetComponent <LineRenderer>().startWidth = 0.06f;
        TurretGun.GetComponent <LineRenderer>().endWidth   = 0.06f;
        TurretGun.GetComponent <LineRenderer>().startColor = Color.white;
        TurretGun.GetComponent <LineRenderer>().endColor   = Color.cyan;

        TurretBase.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("TurretBase");
        TurretGun.GetComponent <SpriteRenderer>().sprite  = Resources.Load <Sprite>("Laserbeam");

        Cost = 70;
        TurretGun.AddComponent <LaserbeamScript>();
    }