Ejemplo n.º 1
0
    // Circuit error 1
    public static void CircuitError(ICircuitElement element)
    {
        Whisp whisp = FindObjectOfType <Whisp>();            // tuna je ta chyba niekde,, bez tohto nevyhadzuje nikde chybu

        /*string path = element.ToString();
         * int pos = path.LastIndexOf(".", StringComparison.Ordinal) + 1;
         * string componentName = path.Substring(pos, path.Length - pos);
         *
         * string toFindInRes = path.Substring(pos, path.Length - pos);
         * string resComponentName = ResourceReader.Instance.GetResource("ComponentText" + componentName);
         * string resCircuitErrorMsg = ResourceReader.Instance.GetResource("CircuitErrorMSG1");
         * resCircuitErrorMsg = resCircuitErrorMsg.Replace("{COMPONENTNAME}", resComponentName);
         *
         * string windowName = "ERRORMSG_" + componentName;
         *
         * if (GameObject.Find(windowName))
         * {
         *  bool currentlyEnabled = GameObject.Find(windowName).GetComponent<Canvas>().enabled;
         *  if (currentlyEnabled == false)
         *  {
         *      currentlyEnabled = true;
         *      GameObject.Find(windowName).GetComponent<Canvas>().enabled = true;
         *  }
         *  else
         *  {
         *      currentlyEnabled = false;
         *      GameObject.Find(windowName).GetComponent<Canvas>().enabled = false;
         *  }
         * }
         * else
         * {
         *  whisp.Say(ResourceReader.Instance.GetResource("CircuitErrorMissingErrorBox") + "{" + resComponentName + "}");
         * }
         * whisp.Say(resCircuitErrorMsg);*/
    }
Ejemplo n.º 2
0
    /*  void OnCollisionEnter(Collision col)
     * {
     *    if (col.gameObject.CompareTag("light"))
     *    {
     *
     *        Destroy(col.gameObject);
     *    }
     * }*/

    private void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.CompareTag("light"))
        {
            Debug.Log(spawnIndicator);
            Whisp Whisp          = col.gameObject.GetComponent <Whisp>();
            int   colorIndicator = Whisp.indicator;
            Destroy(col.gameObject);
            spawnInsideWhisp(colorIndicator, spawnIndicator);
            spawnIndicator++;
        }
    }
Ejemplo n.º 3
0
 private bool InstanceVisible(Whisp whisp)
 {
     return(true);
 }