void Start() { spawnerScript = gameObject.GetComponent <PuzzelItem>(); InfoSize = new Vector2(319, 240); InfoWindowPosition = new Vector2(4, (Screen.height - 250)); InfoWindowSize = new Vector2(540, 340); }
void Start() { spawnerScript = FindObjectOfType <PuzzelItem>(); rotatePuzzel = FindObjectOfType <RotateObjects>(); selectScript = FindObjectOfType <SelectObject>(); shakeScript = FindObjectOfType <CameraShaking>(); inventory = FindObjectOfType <Inventory> (); startPosition = transform.position; }
private void TestPuzzelItemFunctionallities(Item i) { if (i is PuzzelItem) { //Casting PuzzelItem pi = (PuzzelItem)i; print("========== Testing PuzzelItem functionallities =========="); print("The riddle of " + pi.GetName() + " is: " + pi.GetRiddle()); print("the answer you gave is: " + pi.GetAnswer()); print("Your answer is:" + pi.CheckForAnswer(pi.GetAnswer())); } }
void Start() { spawnerScript = gameObject.GetComponent<PuzzelItem>(); InfoSize = new Vector2(319,240); InfoWindowPosition = new Vector2(4,(Screen.height - 250)); InfoWindowSize = new Vector2(540,340); }
void Start() { spawnerScript = this.gameObject.GetComponent<PuzzelItem>(); rotatePuzzel = this.gameObject.GetComponent<RotateObjects>(); selectScript = this.gameObject.GetComponent<SelectObject>(); shakeScript = this.gameObject.GetComponent<CameraShaking>(); scoreScript = this.gameObject.GetComponent<Scores> (); startPosition = transform.position; }
private void TestInventoryFunctioanlity() { print("========== Testing inventory functionalities =========="); Item i = new AccessItem("Key of Doom", 10, 1); Item j = new BonusItem("Patato of the gods", 50, 50); Item k = new BonusItem("Globe of eternal sunshine", 50, 100); Item l = new PuzzelItem("Riddle01", 10, "What is an lama of islam?", "Islama"); //added item if (inventory.AddItem(i)) { print("Added " + i.GetName() + " to the inventory"); } else { print("Failed to add " + i.GetName() + " to the inventory"); } //added item if (inventory.AddItem(j)) { print("Added " + j.GetName() + " to the inventory"); } else { print("Failed to add " + j.GetName() + " to the inventory"); } //added item if (inventory.AddItem(k)) { print("Added " + k.GetName() + " to the inventory"); } else { print("Failed to add " + k.GetName() + " to the inventory"); } //added riddle if (inventory.AddItem(l)) { print("Added " + l.GetName() + " to the inventory"); } else { print("Failed to add " + l.GetName() + " to the inventory"); } inventory.DebugInventory(); if (inventory.CanOpenDoor(1)) { print("Door 1 can be opened."); } else { print("Door 1 can NOT be opened"); } if (inventory.CanOpenDoor(2)) { print("Door 2 can be opened."); } else { print("Door 2 can NOT be opened"); } if (inventory.HasItem(i)) { print("Inventory has key of doom"); } else { print("Inventory doenst have key of doom"); } if (inventory.RemoveItem(i)) { print("Key removed"); } else { print("Key was nont removed"); } if (inventory.CanOpenDoor(1)) { print("Door 1 can be opened."); } else { print("Door 1 can NOT be opened"); } if (inventory.HasItem(i)) { print("Inventory has key of doom"); } else { print("Inventory doenst have key of doom"); } TestPuzzelItemFunctionallities(l); }
void Start() { spawnerScript = FindObjectOfType<PuzzelItem>(); rotatePuzzel = FindObjectOfType<RotateObjects>(); selectScript = FindObjectOfType<SelectObject>(); shakeScript = FindObjectOfType<CameraShaking>(); inventory = FindObjectOfType<Inventory> (); startPosition = transform.position; }