Ejemplo n.º 1
0
    public IEnumerator fn_Bunsen_Burner(LabState LS)
    {
        // if (LS == LabState.UsingItem)
        //{
        m_Content.SetActive(true);
        LabManager.LM.m_LabState = LabState.Idle;
        LabManager.LM.fn_ResetCurrentSelectedTool();

        ApplicationManager.AM.m_Scenes[ApplicationManager.AM.m_CurrentScenesIndex].
        m_Missions[ApplicationManager.AM.m_Scenes[ApplicationManager.AM.m_CurrentScenesIndex].LastMissionIndex].isDone = true;
        LabManager.LM.fn_UpdateMissionText(ApplicationManager.AM.m_Scenes[ApplicationManager.AM.m_CurrentScenesIndex].LastMissionIndex + 1);
        ApplicationManager.AM.m_Scenes[ApplicationManager.AM.m_CurrentScenesIndex].LastMissionIndex++;
        LabManager.LM.m_ToolText.text = "ﺔﺤﻴﺤﺻ ﺓﻮﻄﺧ";

        yield  return(new WaitForSeconds(m_BunsenBurner_Timer));

        if (m_ChildTools != null)
        {
            m_ChildTools[0].GetComponent <Tool>().m_ToolTempreture = 10;
        }
        else
        {
            Debug.Log("Beaker not a child to bunsen burner");
        }

        //}
        // else
        //{
        //  Debug.Log("Action Can't be applied to this tool"); // TODO Change to dynamic on screen arabic text
        // }
    }
Ejemplo n.º 2
0
 public void fn_Container(LabState LS, Tool OtherTool)
 {
     if (LS == LabState.EmptyingItem)
     {
         if (OtherTool.m_ToolType == ToolType.Container_Sample || OtherTool.m_ToolType == ToolType.Mortar_Pestle)
         {
             // GameObject DropedContent = Instantiate(m_Content, OtherTool.m_ContentPosition.position, OtherTool.gameObject.transform.rotation, OtherTool.gameObject.transform);
             //OtherTool.m_Content = DropedContent;
             LabManager.LM.m_LabState = LabState.Idle;
             LabManager.LM.fn_ResetCurrentSelectedTool();
         }
     }
 }
Ejemplo n.º 3
0
 public void fn_TestingTube(LabState LS, Tool Beaker)
 {
     if (Beaker.m_ToolType == ToolType.Beaker)
     {
         if (Beaker.isFull == true && Beaker.fn_GetBeakerContentPrePosition() != new Vector3(0, 0, 0))
         {
             gameObject.transform.position = Beaker.fn_GetBeakerContentPrePosition();
         }
         else
         {
             Debug.Log("Something went wrong!");
         }
         Beaker.originalTestingTubePosition = transform.position;
         gameObject.transform.position      = Beaker.m_ContentPosition.position;
         Beaker.m_Content = gameObject;
         Beaker.isFull    = true;
     }
 }
Ejemplo n.º 4
0
    public void fn_Mortar_Pestle(LabState LS, Tool OtherTool)
    {
        if (LS == LabState.UsingItem)
        {
            if (isFull == false)
            {
                Smash(m_Content.tag);
                isFull = true;
                LabManager.LM.m_LabState = LabState.Idle;
                LabManager.LM.fn_ResetCurrentSelectedTool();
            }
            else
            {
                Debug.Log("Already Smashed!"); // TODO Change to dynamic arabic text
            }
        }

        else if (LS == LabState.EmptyingItem)
        {
            if (isFull == true)
            {
                if (OtherTool.m_ToolType == ToolType.Container_Sample)
                {
                    //GameObject DropedContent = Instantiate(m_Content, OtherTool.m_ContentPosition.position, OtherTool.gameObject.transform.rotation, OtherTool.gameObject.transform);
                    //OtherTool.m_Content = DropedContent;
                    //GameObject.Destroy(m_Content.gameObject);
                    isFull = false;
                    LabManager.LM.m_LabState = LabState.Idle;
                    LabManager.LM.fn_ResetCurrentSelectedTool();
                }
                else
                {
                    Debug.Log("Can't empty content in this tool"); //TODO Change to dynamic on screen arabic text
                }
            }
            else
            {
                Debug.Log("No content!"); // TODO Change to dynamic arabic text
            }
        }
    }
Ejemplo n.º 5
0
        internal static string ToSerializedValue(this LabState value)
        {
            switch (value)
            {
            case LabState.Draft:
                return("Draft");

            case LabState.Publishing:
                return("Publishing");

            case LabState.Scaling:
                return("Scaling");

            case LabState.Syncing:
                return("Syncing");

            case LabState.Published:
                return("Published");
            }
            return(null);
        }
Ejemplo n.º 6
0
    public void fn_Dropper(LabState LS, Tool OtherTool)
    {
        if (LS == LabState.UsingItem)
        {
            if (isFull == false)
            {
                if (OtherTool.m_ToolType == ToolType.Distilled_Water || OtherTool.m_ToolType == ToolType.Egg_Yolk || OtherTool.m_ToolType == ToolType.Glucose_Solution ||
                    OtherTool.m_ToolType == ToolType.Iodine_Solution || OtherTool.m_ToolType == ToolType.Starch_Solution || OtherTool.m_ToolType == ToolType.Benedict_Reagent)
                {
                    //GameObject newContent = Instantiate(OtherTool.m_Content, m_ContentPosition.position, transform.rotation, transform);
                    //m_Content = newContent;
                    isFull = true;
                    LabManager.LM.m_LabState = LabState.Idle;
                    LabManager.LM.fn_ResetCurrentSelectedTool();
                }
                else
                {
                    Debug.Log("Can't Use dropper with this tool"); // TODO Change to dynamic on screen arabic text
                }
            }
            else
            {
                Debug.Log("Dropper is full, empty it first"); // TODO Change to dynamic on screen arabic text
            }
        }

        else if (LS == LabState.EmptyingItem)
        {
            if (isFull == true)
            {
                if (OtherTool.m_ToolType == ToolType.Container_Sample || OtherTool.m_ToolType == ToolType.MircoScope_GlassSection || OtherTool.m_ToolType == ToolType.Mortar_Pestle ||
                    OtherTool.m_ToolType == ToolType.TestingTube)
                {
                    // GameObject DropedContent = Instantiate(m_Content, OtherTool.m_ContentPosition.position, OtherTool.gameObject.transform.rotation, OtherTool.gameObject.transform);
                    // OtherTool.m_Content = DropedContent;

                    /* switch (OtherTool.m_Content.tag)
                     * {
                     *   case "Glucose Solution":
                     *       if (m_Content.tag == "Bendict Reagent")
                     *       {
                     *           // TODO CHANGE COLOR FROM BLUE TO ORANGE
                     *       }
                     *       break;
                     *
                     *   case "Bread":
                     *       if (m_Content.tag == "Iodine Solution")
                     *       {
                     *           // TODO CHANGE COLOR FROM ORANGE TO DARK BLUE
                     *       }
                     *       break;
                     *
                     *   case "Wheat Seeds":
                     *       if (m_Content.tag == "Iodine Solution")
                     *       {
                     *           // TODO CHANGE COLOR FROM ORANGE TO DARK BLUE
                     *       }
                     *       break;
                     *
                     *   case "Peas Seeds":
                     *       if (m_Content.tag == "Iodine Solution")
                     *       {
                     *           // TODO CHANGE COLOR FROM ORANGE TO LIGHT BLUE
                     *       }
                     *       break;
                     *
                     *   default: Debug.Log("No specified behavior");
                     *       break;
                     * }*/

                    fn_ClearContent();
                    LabManager.LM.m_LabState = LabState.Idle;
                    LabManager.LM.fn_ResetCurrentSelectedTool();
                }
                else
                {
                    Debug.Log("Can't Empty Dropper in this tool"); // TODO Change to dynamic on screen arabic text
                }
            }
            else
            {
                Debug.Log("Dropper has no content"); // TODO Change to dynamic on screen arabic text
            }
        }

        fn_Interact(OtherTool, 90f, 0, 0);
    }
Ejemplo n.º 7
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="LabState" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LabState.CreateFrom(sourceValue);