예제 #1
0
    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);
    }
예제 #2
0
 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);
     }
 }
예제 #3
0
 // 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();
 }