public void Init(Resource resourceType) { gameObject.SetActive(true); this.resourceType = resourceType; strength = ResourceSettings.GetStrength(resourceType); this.gameObject.GetComponent <SpriteRenderer>().sprite = ResourceSettings.GetSprite(resourceType); }
public void GetDestroyed() { value = 0; if (onBlockDestroy != null) { foreach (ResourceBlock block in blocks) { value += ResourceSettings.GetValue(block.resourceType); } onBlockDestroy(value); } this.gameObject.transform.position = new Vector3(this.gameObject.transform.position.x, this.gameObject.transform.position.y - 4.5f, this.gameObject.transform.position.z); Manager.Instance.currentLayer += 1; GenerateBlock(); }
public void Init() { instance = this; }