public BugableObjectStateViewController(BugableObjectInfo info) { //int index = Object prefab = ViewControllerManager.Instance.viewControllers[0]; GameObject go = Instantiate(prefab, ViewControllerManager.Instance.viewControllerCanvas.transform) as GameObject; BugableObjectStateViewController script = go.GetComponent <BugableObjectStateViewController>(); script.Init(info); }
public void Init(BugableObjectInfo info) { //Debug.Log("init BugableObjectStateViewController with info " + info.name); objectName.text = info.name; objectDescription.text = info.description; objectIcon.sprite = info.icon; foreach (BugableObjectFunctionInfo functionInfo in info.EnabledBugableFunctions) { new BugableObjectStateFunctionCell(functionInfo, cellPrefab, functionTableTransform); } }
// Use this for initialization protected virtual void Start() { info = BugableObjectManager.Instance.bugableObjectInfoDict[Identifier]; if (info == null) { Debug.LogError(Identifier + " does not exist in bugable object info dict"); } UpdateAlertView(); AddObserveUpdateFunction(); if (hintSpriteRender != null) { redColor = hintSpriteRender.color; transparentColor = new Color(redColor.r, redColor.g, redColor.b, 0); } else { Debug.LogError("hintSpriteRender is missing"); } BugableObjectManager.Instance.RegisterBugableObject(this); HideHint(); }