public Hammer Setup(HammerSlot slot) { spriteObj = transform.Find("Sprite"); this.slot = slot; ownTransform = transform; ownTransform.position = slot.transform.position + (Vector3.forward * -1f); updatedPosition = ownTransform.position - spriteObj.localPosition; return(this); }
void Start() { GameObject[] objs = GameObject.FindGameObjectsWithTag("HammerSlot"); marmots = new List <Marmot>(GetComponentsInChildren <Marmot>()); int index = 0; while (index < objs.Length) { HammerSlot hammerSlot = objs[index].GetComponent <HammerSlot>(); slots.Add(hammerSlot); hammerSlot.Spawn(); index++; } marmotCounterAnim = marmotCounter.GetComponent <Animator>(); clock = Timer.Instance; clock.Play(); StartMarmots(); }