// Use this for initialization void Start() { PS = GetComponent <ParticleSystem>(); PS.Stop(); scaleUpwards = true; transform.localScale = new Vector3(minMaxButtonScale.x, minMaxButtonScale.x, minMaxButtonScale.x); CS = Camera.main.GetComponent <scr_CameraScript>(); }
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>(); }
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; }