private void Awake() { Instance = this; toolRadius = toolStartRadius; for (int i = 0; i < toolUI.Length; ++i) { if (toolUI[i] != null) { toolUI[i].SetActive(false); } } for (int i = 0; i < placableObjects.Length; ++i) { GameObject b = Instantiate(placableObjectButtonPrefab); Button btn = b.GetComponentInChildren <Button>(); int idx = i; btn.onClick.AddListener(delegate { SetPlacableObject(idx); }); Text btntxt = b.GetComponentInChildren <Text>(); btntxt.text = placableObjects[i].name; b.transform.parent = placableObjectButtonPanel; } if (placableObjects.Length > 0) { SetPlacableObject(0); } }
private void SendGodInputs(GodController god) { //Implement input-actions in godcontroller.cs, then call that here. if (currentGodSelectInput) { god.Emote(); } }
private void PickupItem() { if (itemType != ItemType.LifePickup) { GodController godController = GameObject.FindGameObjectWithTag("God").GetComponent <GodController>(); godController.SubmitItemForQuest(itemType, itemSprite); Destroy(gameObject); } else if (itemType == ItemType.LifePickup) { //Player player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>(); //player.Damage(); } foreach (Transform child in this.transform) { GameObject.Destroy(child.gameObject); } Destroy(this.gameObject); }
protected virtual void OnValidate() { gc = FindObjectOfType <GodController>(); }
private void Awake() { controller = new GodController(this, config, data); }