Example #1
0
        //-----------------------------------------------------------------------------------------------
        public InfluenceMapPoint GetPointOfHighestInfluence()
        {
            uint indexOfHighestInfluence = GetIndexOfHighestInfluence();
            InfluenceMapPoint pointOfHighestInfluence = ConvertIndexToMapPoint(indexOfHighestInfluence);

            return(pointOfHighestInfluence);
        }
    //-----------------------------------------------------------------------------------------------
    public void OnSceneGUI(SceneView sceneView)
    {
        if (!m_showHighestInfluencePoint)
        {
            return;
        }

        // Save previous state
        Color oldColor = Handles.color;

        foreach (MapSelection selection in m_mapSelections)
        {
            if ((selection.m_isHidden) ||
                (selection.m_activeMap == null))
            {
                continue;
            }

            Color mapColor   = selection.m_renderColor;
            Color outerColor = new Color(mapColor.r, mapColor.g, mapColor.b, 1f);
            Color innerColor = new Color(mapColor.r, mapColor.g, mapColor.b, .3f);

            InfluenceMapPoint         highestPoint = selection.m_activeMap.GetPointOfHighestInfluence();
            InfluenceObjectWorldPoint worldPos     = m_influenceSystemRef.ConvertMapPosToWorldPos(highestPoint);
            Vector3 unityWorldPos = new Vector3(worldPos.x, worldPos.y, 0f);

            // Draw point
            Handles.color = innerColor;
            Handles.DrawSolidDisc(unityWorldPos, new Vector3(0f, 0f, 1f), .3f);

            Handles.color = outerColor;
            Handles.DrawWireDisc(unityWorldPos, new Vector3(0f, 0f, 1f), .3f);
        }

        // Restore old state
        Handles.color = oldColor;
    }