Beispiel #1
0
 /// <summary>
 /// Set all tools depending on their type to the respective variable.
 /// </summary>
 /// <param name="toolList"></param>
 private void setTools(List <ControllerTool> toolList)
 {
     foreach (ControllerTool tool in toolList)
     {
         if (tool is GUIController)
         {
             m_GUIController = (GUIController)tool;
         }
         else if (tool is SelectorTool)
         {
             m_SelectorTool = (SelectorTool)tool;
         }
         else if (tool is ShootingTool)
         {
             m_ShootingTool = (ShootingTool)tool;
         }
         else if (tool is TimeTool)
         {
             m_TimeTool = (TimeTool)tool;
         }
     }
 }
Beispiel #2
0
    /// <summary>
    /// Set all tools depending on their type to the respective variable.
    /// </summary>
    /// <param name="toolList"></param>
    private void setTools(List <ControllerTool> toolList)
    {
        List <SelectionWheelPart> toolWheelParts = new List <SelectionWheelPart>();
        List <SelectionWheelPart> guiWheelParts  = new List <SelectionWheelPart>();

        foreach (ControllerTool tool in toolList)
        {
            if (tool is GUIController)
            {
                m_GUIController = (GUIController)tool;
            }
            else if (tool is ModelSpawnController)
            {
                m_ModelSpawnController = (ModelSpawnController)tool;
            }
            else if (tool is SelectorTool)
            {
                m_SelectorTool = (SelectorTool)tool;
            }
            else if (tool is ShootingTool)
            {
                m_ShootingTool = (ShootingTool)tool;
            }
            else if (tool is TimeTool)
            {
                m_TimeTool = (TimeTool)tool;
            }
            else if (tool is ViewController)
            {
                m_ViewController = (ViewController)tool;
            }
            else if (tool is HandTool)
            {
                m_HandTool = (HandTool)tool;
            }

            if (m_ToolWheel)
            {
                SelectionWheelPart toolWheelPart;
                if ((toolWheelPart = tool.gameObject.GetComponent <SelectionWheelPartTool>()) != null)
                {
                    toolWheelParts.Add(toolWheelPart);
                }
            }
            if (m_GUIWheel)
            {
                SelectionWheelPart GUIWheelPart;
                if ((GUIWheelPart = tool.gameObject.GetComponent <SelectionWheelPartGUITool>()) != null)
                {
                    guiWheelParts.Add(GUIWheelPart);
                }
            }
        }

        if (m_ToolWheel)
        {
            m_ToolWheel.BindController(m_SelectorTool.ControllerObject);
            m_ToolWheel.Initialize(toolWheelParts, 0);
            m_ToolWheel.gameObject.SetActive(false);
        }
        if (m_GUIWheel)
        {
            m_GUIWheel.BindController(m_GUIController.ControllerObject);
            m_GUIWheel.Initialize(guiWheelParts, 0);
            m_GUIWheel.gameObject.SetActive(false);
        }
    }