Exemplo n.º 1
0
        public void TransferTo(CritterName other)
        {
            if (other == null || !HasName())
            {
                return;
            }

            other.critterName = critterName;
            other.generation  = generation;

            if (other.IsEgg())
            {
                other.generation += 1;
            }

            other.ApplyName();
        }
Exemplo n.º 2
0
 private static void OnLayEgg(CritterName component, object data)
 {
     component.TransferTo((data as GameObject).GetComponent <CritterName>());
 }
Exemplo n.º 3
0
 private static void OnSpawnedFrom(CritterName component, object data)
 {
     (data as GameObject).GetComponent <CritterName>()?.TransferTo(component);
 }