示例#1
0
 // Use this for initialization
 void Start()
 {
     ISM = GameObject.Find("GameManager").GetComponent <scr_IngameSoundManager>();
     collectedGameObjects = new List <GameObject>();
     pooler    = GameObject.FindGameObjectWithTag("pooler").GetComponent <scr_obp>();
     cannonAim = transform.GetChild(0);
 }
    // Use this for initialization
    void Start()
    {
        GM     = GameObject.Find("GameManager").GetComponent <scr_GameManager>();
        BM     = GameObject.FindGameObjectWithTag("bag").GetComponent <scr_bagMovement>();
        ISM    = GM.GetComponent <scr_IngameSoundManager>();
        pooler = GameObject.FindGameObjectWithTag("pooler").GetComponent <scr_obp>();
        FH     = GM.GetComponent <scr_FileHandler>();
        PE     = GM.GetComponent <scr_PotionEffects>();

        collectedParticles = 0;
        m_particle_1_score = GM.GetParticleScore(0);
        m_particle_2_score = GM.GetParticleScore(1);
        m_particle_3_score = GM.GetParticleScore(2);

        //The actual amount of particles;
        maxParticles = GM.GetMaxWinParticles() * GM.GetMaxBagAmount();
        maxScore     = maxParticles * (int)m_particle_2_score;

        //Håkans particle systems for when particles enters the glassjar
        emitPosition1 = transform.GetChild(0);
        PS1           = emitPosition1.GetComponent <ParticleSystem>();
        PS1.Stop();

        emitPosition2 = transform.GetChild(1);
        PS2           = emitPosition2.GetComponent <ParticleSystem>();
        PS2.Stop();

        emitPosition3 = transform.GetChild(2);
        PS3           = emitPosition3.GetComponent <ParticleSystem>();
        PS3.Stop();
        //End Håkans potions
    }
    //0. NONE

    //1.    SuperBounce Potion:
    //-	Makes the bag increase in velocity for three bounces. Get 25% more velocity instead of slowing down for 3 bounces. (Make sure bag doesn’t clip out of level.)

    //2.	Gigantic Potion:
    //-	Grain Size (and hitbox) increased by 50%.

    //3.	Miniature Potion:
    //-	Grain size (and hitbox) reduced by 50%.

    //4.	Success Potion.
    //-	Any gold picked up is increased by 50%.

    //5.	Presence Potion.
    //-	Gives the player a chance to change the direction that the bag is travelling by clicking around the bag.

    //6.	Iron Potion.
    //-	Grain falls incredibly quickly and doesn’t bounce.

    //7.	Score Potion.
    //-	Adds 5% of the scores total again.

    //8.	Slow Motion Potion.
    //-	Bag and grain move in slow-motion. (50% of normal speed.)

    void Start()
    {
        FH     = GetComponent <scr_FileHandler>();
        IS     = GetComponent <scr_IngameSoundManager>();
        GM     = GetComponent <scr_GameManager>();
        WBH    = GameObject.FindGameObjectWithTag("win").GetComponent <scr_winbagBehaviour>();
        SP     = GameObject.FindGameObjectWithTag("bag").GetComponent <spawnParticles>();
        BM     = GameObject.FindGameObjectWithTag("bag").GetComponent <scr_bagMovement>();
        bag    = GameObject.FindGameObjectWithTag("bag");
        pooler = GameObject.FindGameObjectWithTag("pooler").GetComponent <scr_obp>();

        //  none, SuperBounce, Gigantic, Minature, Success, Presence, Iron, Score , Slow_Motion
        m_potionType[0] = PotionType.none;
        m_potionType[1] = PotionType.SuperBounce;
        m_potionType[2] = PotionType.Gigantic;
        m_potionType[3] = PotionType.Minature;
        m_potionType[4] = PotionType.Success;
        m_potionType[5] = PotionType.Presence;
        m_potionType[6] = PotionType.Iron;
        m_potionType[7] = PotionType.Score;
        m_potionType[8] = PotionType.Slow_Motion;

        m_bouncePower        = BM.bouncePower;
        m_ScaleMultiplier    = bag.transform.localScale.x;
        m_goldMultiplier     = 1;
        m_extraThrow         = false;
        m_gravity            = 1.0f;
        m_scoreEndMultiplier = 1.0f;;
        m_timeScale          = 1;
        m_drag = bag.GetComponent <Rigidbody2D>().drag;
    }
示例#4
0
 void Awake()
 {
     current = this;
     PutIntoList(m_particle_1_storage, l_particle_1, particle_1, "p1");
     PutIntoList(m_particle_2_storage, l_particle_2, particle_2, "p2");
     PutIntoList(m_particle_3_storage, l_particle_3, particle_3, "p3");
     ISM = GameObject.Find("GameManager").GetComponent <scr_IngameSoundManager>();
 }
示例#5
0
 void Awake()
 {
     openSurveyonce = false;
     m_EndGameMenu  = GameObject.Find("EndGameMenu");
     ISM            = GetComponent <scr_IngameSoundManager>();
     m_EndGameMenu.SetActive(false);
     showEndGameMenu = false;
 }
	void Awake () 
    {
        BM = this.GetComponent<scr_bagMovement>();
        m_frameCounter = 1;
        GM = GameObject.Find("GameManager").GetComponent<scr_GameManager>();
        ISM = GM.GetComponent<scr_IngameSoundManager>();

        particleAmount = GM.GetMaxWinParticles();
        objectPooler = GameObject.FindGameObjectWithTag("pooler").GetComponent<scr_obp>();
        m_exploding = false;
	}
示例#7
0
    void Awake()
    {
        extraThrow            = false;
        throwExtraOnce        = true;
        startScale            = transform.localScale.x;
        hasTakenPosInput      = false;
        BagCollider           = GetComponent <BoxCollider2D>();
        BagCollider.isTrigger = true;
        GM     = GameObject.Find("GameManager").GetComponent <scr_GameManager>();
        CS     = Camera.main.GetComponent <scr_CameraScript>();
        PS     = GetComponent <ParticleSystem>();
        PSGold = GameObject.Find("goldPickup").GetComponent <ParticleSystem>();


        if (GameObject.Find("BagBoundaries").GetComponent <BoxCollider2D>() != null)
        {
            bagThrowBoundaries = GameObject.Find("BagBoundaries").GetComponent <BoxCollider2D>();
        }
        else
        {
            Debug.LogError("BagBoundaries need BoxCollider2D");
        }
        aimingArrow = GameObject.FindGameObjectWithTag("aimarrow");
        aimingArrow.SetActive(false);
        BS                = BagState.idle;
        bag               = this.gameObject;
        bagRB             = bag.GetComponent <Rigidbody2D>();
        bagRB.isKinematic = true;
        SP                = gameObject.GetComponent <spawnParticles>();
        PS.Stop();
        PSGold.Stop();

        bagMaterial            = bag.GetComponent <BoxCollider2D>().sharedMaterial;
        bagMaterial.bounciness = bouncePower;
        remainingBounces       = bounces;
        ISG = GameObject.Find("GameManager").GetComponent <scr_IngameSoundManager>();
    }
示例#8
0
 void Awake()
 {
     M_DelayBeforeLvlSwap = 30;
     PopUpMenu            = GameObject.Find("PopUpMenu").GetComponent <Transform>();
     CanvasStuff          = PopUpMenu.GetComponent <scr_CanvasStuff>();
     scaleUpwards         = true;
     activeButton         = null;
     OpenSurveyOnce       = true;
     m_BT           = BagType.def;
     Time.timeScale = 1;
     m_Camera       = Camera.main.GetComponent <scr_CameraScript>();
     m_EGS          = EndGameState.none;
     ISM            = GetComponent <scr_IngameSoundManager>();
     PE             = GetComponent <scr_PotionEffects>();
     FH             = GetComponent <scr_FileHandler>();
     if (m_bagAmount > 0 && !GameObject.FindGameObjectWithTag("bag"))
     {
         Instantiate(bag, m_bagSpawnPos.position, Quaternion.identity);
         bag.SetActive(true);
         m_bagAmount -= 1;
     }
     m_showEndGameMenu = false;
     m_DisplayOnce     = true;
 }