Exemple #1
0
 private void SetPoopComponent(Poop poo)
 {
     poo.effectRadius   = this.effectRadius;
     poo.spriteRenderer = poo.GetComponent <SpriteRenderer>();
     poo.poopSprites    = this.poopSprites;
     poo.finalPosition  = finalPosition;
     poo.moving         = true;
     poo.shouldUpdate   = true;
     // Destroy(poo.GetComponent<GameObject>(), 2f);
     poo.InvokeRepeating("AnimatePoop", 0f, 0.15f);
 }
Exemple #2
0
        public Poop(Vector3 initial, Vector3 position)
        {
            position.z = -2f;
            initial.z  = -2f;
            LoadSprites();

            this.finalPosition = position;
            int maxPoopSize = Random.Range(0, 3);

            effectRadius = maxPoopSize;

            poop = Resources.Load <GameObject>("GameObjects/poop");
            GameObject poopInstance  = Instantiate(poop, initial, Quaternion.identity);
            Poop       poopComponent = poopInstance.AddComponent <Poop>();

            SetPoopComponent(poopComponent);
        }