Created
July 7, 2015 02:27
-
-
Save gotwig/af6b5e0af86a98bc7fe8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
using System.Collections.Generic; | |
public class logicWindow : MonoBehaviour { | |
public GameObject cloneBasis; | |
public Sprite deductionTexture; | |
List<LogicFraDia.logicFragment> logicFragments; | |
List<LogicFraDia.logicDeduction> logicDeductions; | |
List<GameObject> ClonedObjects; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
foreach (GameObject x in ClonedObjects){ | |
Destroy (x); | |
} | |
logicFragments = LogicFraDia.instance.returnFragments (true); | |
logicDeductions = LogicFraDia.instance.returnDeductions (true); | |
foreach (LogicFraDia.logicFragment x in logicFragments) { | |
GameObject clonedObject = Instantiate(cloneBasis, cloneBasis.transform.position, cloneBasis.transform.rotation) as GameObject; | |
ClonedObjects.Add (clonedObject); | |
clonedObject.transform.SetParent(gameObject.transform); | |
clonedObject.transform.localScale = cloneBasis.transform.localScale; | |
clonedObject.transform.Find("Background").transform.Find("Label").GetComponent<Text>().text = x.name; | |
} | |
foreach (LogicFraDia.logicDeduction x in logicDeductions) { | |
GameObject clonedObject = Instantiate(cloneBasis, cloneBasis.transform.position, cloneBasis.transform.rotation) as GameObject; | |
ClonedObjects.Add (clonedObject); | |
clonedObject.transform.SetParent(gameObject.transform); | |
clonedObject.transform.localScale = cloneBasis.transform.localScale; | |
clonedObject.transform.Find("Background").transform.Find("type").GetComponent<Image>().sprite = deductionTexture; | |
clonedObject.transform.Find("Background").transform.Find("Label").GetComponent<Text>().text = x.name; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment