private void OnTriggerEnter2D(Collider2D collision) { GameObject other = collision.gameObject; if (collision.CompareTag("Respawn")) { respawnPos = transform.position; } Star star = other.GetComponent <Star>(); if (star != null && !star.playerTouched) { star.playerTouched = true; gm.CollectStar(star); Destroy(other); StarCollectSound.Play(); int starType = (int)gm.levelStarPrefab.GetComponent <Star>().starType; if (gm.starsCollected[starType] >= portal.starsRequired) { if (Slime.activeSelf) { SlimeManager slimeManager = Slime.GetComponent <SlimeManager>(); slimeManager.DestroyBridge(); slimeManager.sprite.SetActive(false); } SlimeGuide.SetActive(true); } } Door door = other.GetComponent <Door>(); if (door != null) { gm.ShowHUDDoorStars(door); door.TryOpen(); } Portal portalCollided = other.GetComponent <Portal>(); if (portalCollided != null) { int starType = (int)gm.levelStarPrefab.GetComponent <Star>().starType; if (gm.starsCollected[starType] >= portalCollided.starsRequired) { NextLevel(); } } StarSpot starSpot = other.GetComponent <StarSpot>(); if (starSpot != null && !starSpot.touched) { starSpot.Fill(); } }
private void Start() { playerSlimeManager = FindObjectOfType <SlimeManager>(); drawColliderGizmos = DrawDefaultColliderGizmos; if (col == null) { col = GetComponent <Collider>(); } CheckColliderType(); }
// Start is called before the first frame update void Start() { slime = GetComponent <Slime>(); // TODO HACK if (gameObject.CompareTag("Player")) { sm = FindObjectOfType <UnityEngine.Camera>()?.GetComponent <SlimeManager>(); } currentState = defaultState; }
// Start is called before the first frame update void Start() { slimeManager = GetComponent <SlimeManager>(); if (slimeManager) { slimeManager.onFocusChange += HandleFocusChanged; } if (!playerInputManager) { playerInputManager = GetComponent <PlayerInputManager>(); } currentDesiredDistance = desiredDistance; }
// Start is called before the first frame update void Start() { if (inputManager == null) { inputManager = GetComponent <PlayerInputManager>(); } if (slimeManager == null) { slimeManager = GetComponent <SlimeManager>(); } if (slimeManager != null) { slimeManager.onFocusChange += HandleSlimeFocusChange; } }
// Start is called before the first frame update void Start() { //Set Values gridData = FindObjectOfType <GridData>(); newPixels = new List <PixelData>(); screenWidth = Screen.width; screenHeight = Screen.height; modulePrefab = Resources.Load("modulePrefab") as GameObject; slimeMoldManager = this.GetComponent <SlimeManager>(); //Deactivate Panels sidePanel.SetActive(false); editorPanel.SetActive(false); FillArray(); SetupImage(rawImage); slimeMoldManager.pixelDataChem = texture2DChemical.GetPixels(); drawMode = Enums.DrawMode.Deactivated; SetUIData(true); SetVariablesInSlimeMold(true); }
// Start is called before the first frame update void Start() { SlimeManager.instance = this; }
void Start() { size = 3; sm = this; }
private void Start() { sr = gameObject.GetComponent <SpriteRenderer>(); sm = GameObject.Find("SlimeManager").GetComponent <SlimeManager>(); StartAnimation(); }
void Awake() { SlimeManager.Shared = this; this.screens = new Dictionary <string, SlimeScreenRenderer>(); }