// Update is called once per frame void Update() { myBubble.copyParentName(name); myBubble.setParent(transform); if (Input.GetKeyDown(KeyCode.Space)) { Instantiate(FloatingTextClonable); myBubble = FindObjectOfType <FloatingTextControl>(); } if (Input.GetKeyDown(KeyCode.LeftControl)) { myBubble.transparencyOn(); } if (Input.GetKeyUp(KeyCode.LeftControl)) { myBubble.transparencyOff(); } if (Input.GetKey(KeyCode.A)) { myBubble.setMessage("1d4 Dmg" + "\n(0,0)"); } if (Input.GetKeyDown(KeyCode.A)) { myBubble.decreaseSize(); } if (Input.GetKeyUp(KeyCode.A)) { myBubble.copyParentName(name); myBubble.increaseSize(); } if (Input.GetKeyDown(KeyCode.S)) { myBubble.copyParentName(name); } if (Input.GetKeyDown(KeyCode.B)) { myBubble.setParent(transform); } if (Input.GetKeyDown(KeyCode.C)) { myBubble.setColor(); } if (Input.GetKeyDown(KeyCode.PageUp)) { myBubble.increaseSize(); } if (Input.GetKeyDown(KeyCode.PageDown)) { myBubble.decreaseSize(); } }
IEnumerator delayedAccess(FloatingTextControl text, string message, Transform parent) { for (int i = 0; i < 3; i++) { if (i > 1) { text.setParent(parent); text.setMessage(message); text.setColor(); } yield return(null); } }
private accessItem createItemGO(Item item) { print(item.ModelFilename); GameObject itemGO = (GameObject)Instantiate(Resources.Load(item.ModelFilename)); GameObject floatingTextGO = (GameObject)Instantiate(Resources.Load("FloatingText")); FloatingTextControl text = floatingTextGO.GetComponent <FloatingTextControl>(); IEnumerator doThis = delayedAccess(text, item.itemName, itemGO.transform); accessItem itemcs = itemGO.AddComponent <accessItem>(); itemcs.youAre(item); StartCoroutine(doThis); return(itemcs); }
// Start is called before the first frame update void Start() { Instantiate(FloatingTextClonable); myBubble = FindObjectOfType <FloatingTextControl>(); }