예제 #1
0
    public void DisableSuperSkill()
    {
        isUsingSuperFlight = false;
        isUsingSuperSpeed  = false;
        isUsingSuperTime   = false;

        // Remove the superskill trail
        TrailRenderer trailRenderer = gameObject.GetComponentInChildren <TrailRenderer>();

        trailRenderer.enabled = false;

        // Reset gravity to its orignal value
        gameObject.GetComponent <Rigidbody2D>().gravityScale = oriGravityScale;
        PteraMover.DeactivateTimeFreeze();
        CaveFlamePit.DeactivateTimeFreeze();
        Fireball.DeactivateTimeFreeze();
        DestroyByTime.DeactivateTimeFreeze();
        LaserBeam.DeactivateTimeFreeze();
        Saw.DeactivateTimeFreeze();
        LaserTurret.DeactivateTimeFreeze();
        Bat.DeactivateTimeFreeze();
        SwingingBoulder[] sb = FindObjectsOfType <SwingingBoulder>();
        sb[0].DeactivateTimeFreeze();
        sb[1].DeactivateTimeFreeze();
        sb[2].DeactivateTimeFreeze();
        sb[3].DeactivateTimeFreeze();
        sb[4].DeactivateTimeFreeze();
        sb[5].DeactivateTimeFreeze();
        sb[6].DeactivateTimeFreeze();
        RockController.DeactivateTimeFreeze();
        Turret.DeactivateTimeFreeze();
        PlayerController[] players = FindObjectsOfType <PlayerController>();
        foreach (PlayerController p in players)
        {
            p.timeFreezeActivated = false;
            p.GetComponent <Rigidbody2D>().isKinematic = false;
            p.anim.enabled = true;
        }
        GameObject[] FXs = GameObject.FindGameObjectsWithTag("FX");
        foreach (GameObject fx in FXs)
        {
            fx.GetComponent <ParticleSystem>().Play();
        }
        Arrow.DeactivateTimeFreeze();
        Puma.DeactivateTimeFreeze();
        Piranha.DeactivateTimeFreeze();
        Cobra.DeactivateTimeFreeze();
        Saw.DeactivateTimeFreeze();
        Banana.DeactivateTimeFreeze();
        BananaSpawn[] bs = FindObjectsOfType <BananaSpawn>();
        bs[0].DeactivateTimeFreeze();
        bs[1].DeactivateTimeFreeze();
        bs[2].DeactivateTimeFreeze();
    }