// Use this for initialization void Start () { circle = GameObject.FindGameObjectWithTag ("circle").GetComponent<SummoningCircle>(); activeSprite = gameObject.GetComponent<Image> ().sprite; obj = Instantiate (prefab) as GameObject; obj.transform.position = new Vector3 (99f, 0f, 0f); obj.GetComponent<SpriteRenderer> ().sprite = activeSprite; obj.GetComponent<Rune> ().id = name; }
// Update is called once per frame void Update () { circle = GameObject.FindGameObjectWithTag ("circle").GetComponent<SummoningCircle>(); if (circle == null) { return; } if (GameData.runeUnlock [id] == 1) { on = true; gameObject.GetComponent<Image> ().sprite = activeSprite; gameObject.GetComponent<Button> ().enabled = true; } else { on = false; gameObject.GetComponent<Image> ().sprite = defaultSprite; gameObject.GetComponent<Button> ().enabled = false; } }
void Awake() { theManager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameManager> (); theCircle = GameObject.FindGameObjectWithTag ("SummoningCircle").GetComponent<SummoningCircle> (); }
// Use this for initialization void Awake(){ instance = this; }