// Use this for initialization
 void Start()
 {
     fta = GetComponent <ForceTeleportAbility>();
     if (fta)
     {
         maxHoldTime = fta.maxHoldTime;
         ability     = fta;
     }
     sba = GetComponent <ShieldBubbleAbility>();
     if (sba)
     {
         maxHoldTime = sba.maxHoldTime;
         ability     = sba;
     }
 }
 // Use this for initialization
 void Start()
 {
     rb2d          = GetComponent <Rigidbody2D>();
     pc2d          = GetComponent <PolygonCollider2D>();
     gravity       = GetComponent <GravityAccepter>();
     mainCamCtr    = Camera.main.GetComponent <CameraController>();
     gm            = GameObject.FindGameObjectWithTag("GestureManager").GetComponent <GestureManager>();
     halfWidth     = GetComponent <SpriteRenderer>().bounds.extents.magnitude;
     hm            = GetComponent <HardMaterial>();
     hm.shattered += shattered;
     fta           = GetComponent <ForceTeleportAbility>();
     wca           = GetComponent <WallClimbAbility>();
     sba           = GetComponent <ShieldBubbleAbility>();
     teleportRangeParticalController = teleportRangeParticalObject.GetComponent <ParticleSystemController>();
 }
Example #3
0
    public static void enableAbility(int abilityIndex)
    {
        GameObject playerObject = GameManager.getPlayerObject();

        switch (abilityIndex)
        {
        case 1:
            ForceTeleportAbility fta = playerObject.GetComponent <ForceTeleportAbility>();
            fta.enabled = !fta.enabled;
            break;

        case 2:
            WallClimbAbility wca = playerObject.GetComponent <WallClimbAbility>();
            wca.enabled = !wca.enabled;
            break;

        case 3:
            ShieldBubbleAbility sba = playerObject.GetComponent <ShieldBubbleAbility>();
            sba.enabled = !sba.enabled;
            break;
        }
    }
Example #4
0
    public bool generatesAtAll       = true; //false = doesn't do anything

    // Use this for initialization
    void Start()
    {
        cc2D = GetComponent <CircleCollider2D>();
        sba  = GetComponent <ShieldBubbleAbility>();
    }