Esempio n. 1
0
 public void Despawn()
 {
     if (Body)
     {
         Body.Despawn();
     }
     Body = null;
 }
Esempio n. 2
0
        public override InteractableItem CreateItem()
        {
            PickupableBody body = GetComponent <PickupableBody>();

            if (!body)
            {
                return(null);
            }

            return(new PickupableItem(this, body));
        }
Esempio n. 3
0
        public void Spawn(GameObject prefab, Vector3 position)
        {
            GameObject instance = GameObject.Instantiate(prefab);

            instance.transform.position = position;

            PickupableBody sceneItem = instance.GetComponent <PickupableBody>();

            if (sceneItem)
            {
                sceneItem.Init(this);
            }
        }
Esempio n. 4
0
        public PickupableItem(PickupableSeed seed, PickupableBody body) : base(seed)
        {
            Body = body;

            if (Body)
            {
                MainSprite   = Body.MainSprite;
                TopSprite    = Body.TopSprite;
                BottomSprite = Body.BottomSprite;
            }

            Icon = seed.Icon;
        }