本文整理汇总了C#中Inventory.AddToInventory方法的典型用法代码示例。如果您正苦于以下问题:C# Inventory.AddToInventory方法的具体用法?C# Inventory.AddToInventory怎么用?C# Inventory.AddToInventory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory.AddToInventory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
// Use this for initialization
void Awake()
{
Score = GameObject.Find("SCORE").GetComponent<Score>();
Descriptions Descriptions = new Descriptions();
StoryTasks = Descriptions.GetStoryTasks();
StoryPhases = Descriptions.GetPhaseTitles();
RandomGuyJokes = Descriptions.GetRandomGuyJokes();
LevelOverScreen = LevelOverPopup.GetComponent<LevelOverScreen>();
Inventory = new Inventory ();
// TESTING ONLY
Inventory.AddToInventory("knife");
Inventory.AddToInventory("detergent");
LevelBuilder = GameObject.Find("Camera").GetComponent<LevelBuilder>();
ObjectiveScreen = GameObject.Find("Camera").GetComponent<ObjectiveScreen>();
TaskTracker = GameObject.Find ("Camera").GetComponent<TaskTracker>();
// TESTING ONLY
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
//GetRandomJokeBasedOn(Enums.Prisoner.Fatty);
//GetRandomJokeBasedOn(Enums.Prisoner.Midget);
//GetRandomJokeBasedOn(Enums.Prisoner.Skinny);
}
示例2: Start
// Methods //
void Start()
{
// Create static instance
if (Instance == null) Instance = this;
// Create inventory, add additional stuff for debug testing
_inventory = new Inventory();
_inventory.AddToInventory(new Sword());
// Create managers
_characterManager = new CharacterManager();
_cameraManager = new CameraManager(15F, 15F);
_UIManager = new UIManager();
gameObject.AddComponent<BulletManager>();
// Load prefabs from memory
_visualCharacterPrefab = Resources.Load("VisualCharacter");
_projectilePrefab = Resources.Load("ProjectilePlayer");
_textPrefab = Resources.Load("TextPrefab");
// Builders
BuildCharacters();
BuildUI();
_UIManager.InitializePanels();
_UIManager.DisablePanels();
// Fetch all visual characters from the scene
_visCharacters = new List<VisualCharacter>();
_visCharacters.AddRange(GameObject.FindObjectsOfType<VisualCharacter>());
foreach (var item in _visCharacters) item.LateInitialize();
// Other stuff
_characterManager.Human.SetCurrentWeapon(_inventory.CurrentWeapon);
// Physics stuff
Physics.IgnoreLayerCollision(8, 9); // Ignore collision between player and their own bullets
}