// Use this for initialization void Start() { gameObject.GetComponent <Button>().onClick.AddListener(PlaceCreature); scrLevelGen = GameObject.Find("Level").GetComponent <ScriptLevelGenerator>(); startPosition = scrLevelGen.GetStartPosition(); scriptMP = GameObject.Find("TxtMagicPointNumber").GetComponent <ScriptMagicPoint>(); mp = scriptMP.GetMagicPoint(); canBeInteractable = true; }
// Use this for initialization void Start() { timer = 0; isInCombat = false; scriptMP = GameObject.Find("TxtMagicPointNumber").GetComponent <ScriptMagicPoint>(); GameObject detectZone = new GameObject(gameObject.name + "DetectZone"); detectZone.transform.parent = gameObject.transform; detectZone.transform.localPosition = new Vector3(0, 0, 0); Rigidbody2D rb2d = detectZone.AddComponent <Rigidbody2D>(); rb2d.gravityScale = 0; BoxCollider2D bc2d = detectZone.AddComponent <BoxCollider2D>(); bc2d.isTrigger = true; bc2d.size = new Vector2(detectionDistance, detectionDistance); scriptDetectZone = detectZone.AddComponent <ScriptEntityDetectionZone>(); }