C# 클래스 Supermarket.Shelf

Supermarket shelf behaviour script.
상속: UnityEngine.MonoBehaviour, ISelectable
파일 보기 프로젝트 열기: Clarksj4/Theme-Supermarket-Tycoon-World 1 사용 예제들

Private Properties

프로퍼티 타입 설명
Awake void
Notify void
OnTriggerEnter void
Start void

공개 메소드들

메소드 설명
Add ( Product product ) : void

Add the given product to this shelf

AddListener ( IEmptyShelfListener listener ) : void

Add the given interface member to this shelf's list of listeners. The member will be notified when this shelf runs out of stock of each of its products.

ClosestInteractionZone ( Vector3 position ) : GameObject

Get the closest shelf interaction zone to the specified position.

Contains ( string product ) : bool

Tests whether this shelf contains a product of the given name

Get ( string product, int quantity ) : Product

Gets the given product from this shelf. The amount returned is equal to the specified quantity or the amount stocked by the shelf; which ever is less. The shelf has an equal amount of product removed from its inventory.

OnCommand ( Collider clicked, Vector3 position ) : void
OnDeselect ( ) : void
OnSelect ( ) : void
Price ( string product ) : float

Gets the listed price for the given product. Method will raise an exception if the shelf does not stock the product.

Quantity ( string product ) : int

Gets the quantity of items that this shelf stocks for the given product name.

RandomInteractionZone ( ) : GameObject

Gets a random one of this shelf's interaction zones

비공개 메소드들

메소드 설명
Awake ( ) : void
Notify ( string product ) : void

Notifies each listener that this shelf is out of stock of the given product

OnTriggerEnter ( Collider other ) : void
Start ( ) : void

메소드 상세

Add() 공개 메소드

Add the given product to this shelf
public Add ( Product product ) : void
product Product The product to put on this shelf
리턴 void

AddListener() 공개 메소드

Add the given interface member to this shelf's list of listeners. The member will be notified when this shelf runs out of stock of each of its products.
public AddListener ( IEmptyShelfListener listener ) : void
listener IEmptyShelfListener The member to notify when this shelf is out of stock of any product.
리턴 void

ClosestInteractionZone() 공개 메소드

Get the closest shelf interaction zone to the specified position.
public ClosestInteractionZone ( Vector3 position ) : GameObject
position UnityEngine.Vector3 A world position to test for proximity to this shelves interaction zones.
리턴 UnityEngine.GameObject

Contains() 공개 메소드

Tests whether this shelf contains a product of the given name
public Contains ( string product ) : bool
product string The name of the product to test if this shelf stocks.
리턴 bool

Get() 공개 메소드

Gets the given product from this shelf. The amount returned is equal to the specified quantity or the amount stocked by the shelf; which ever is less. The shelf has an equal amount of product removed from its inventory.
public Get ( string product, int quantity ) : Product
product string The name of the product to obtain
quantity int The desired amount of product
리턴 Product

OnCommand() 공개 메소드

public OnCommand ( Collider clicked, Vector3 position ) : void
clicked UnityEngine.Collider
position UnityEngine.Vector3
리턴 void

OnDeselect() 공개 메소드

public OnDeselect ( ) : void
리턴 void

OnSelect() 공개 메소드

public OnSelect ( ) : void
리턴 void

Price() 공개 메소드

Gets the listed price for the given product. Method will raise an exception if the shelf does not stock the product.
public Price ( string product ) : float
product string The name of the product to get the price of.
리턴 float

Quantity() 공개 메소드

Gets the quantity of items that this shelf stocks for the given product name.
public Quantity ( string product ) : int
product string The product to find how many this shelf stocks
리턴 int

RandomInteractionZone() 공개 메소드

Gets a random one of this shelf's interaction zones
public RandomInteractionZone ( ) : GameObject
리턴 UnityEngine.GameObject