Exemplo n.º 1
0
        private void OnEnable()
        {
            var fusion = Fusion.Mount(gameObject);

            fusion.Add(Recipe);
            DestroyImmediate(this);
        }
Exemplo n.º 2
0
        public static Fusion Create(string name, Action <Fusion> addComponents = null)
        {
            var fuser = new Fusion(name);

            if (addComponents != null)
            {
                fuser.Add(addComponents);
            }
            return(fuser);
        }
Exemplo n.º 3
0
        public Fusion NewChild(string tag, Action <Fusion> addParts = null)
        {
            var child = new Fusion(tag);

            child.Transform.SetParent(Transform);
            if (addParts != null)
            {
                child.Add(addParts);
            }
            return(child);
        }
Exemplo n.º 4
0
 private void CreatePrototypes()
 {
     foreach (var kvp in Recipes)
     {
         var recipe = kvp.Value;
         var type   = kvp.Key;
         var go     = Fusion.Create(type.Name, recipe).Go;
         go.transform.SetParent(_prototypesParent);
         go.SetActive(false);
         _prototypes[type] = go;
         _pools[type]      = new Stack <GameObject>();
     }
 }