/// <summary> /// Call this method to force a configuration load. /// </summary> public void LoadConfiguration() { if (config == null) { return; } Hexasphere hexa = GetComponent <Hexasphere> (); if (hexa == null) { Debug.Log("Hexasphere Grid System not found in this game object!"); return; } hexa.textures = textures; hexa.SetTilesConfigurationData(config); }
void Start() { // Gets the script for the "Hexasphere" gameobject hexa = Hexasphere.GetInstance("Hexasphere"); hexa.OnTileClick += TileClick; hexa.OnTileMouseOver += TileMouseOver; // Color North in red int ti = hexa.GetTileAtPos(new Vector3(0, 50, 55)); hexa.SetTileColor(ti, Color.red); // Color opposite tile (South) in blue ti = hexa.GetTileAtPolarOpposite(ti); hexa.SetTileColor(ti, Color.blue); // Color opposite tile (Horizon) in green ti = hexa.GetTileAtPos(new Vector3(0, 0, 5)); hexa.SetTileColor(ti, Color.green); }
void OnEnable() { titleColor = EditorGUIUtility.isProSkin ? new Color(0.52f, 0.66f, 0.9f) : new Color(0.12f, 0.16f, 0.4f); style = serializedObject.FindProperty("_style"); numDivisions = serializedObject.FindProperty("_numDivisions"); smartEdges = serializedObject.FindProperty("_smartEdges"); transparent = serializedObject.FindProperty("_transparent"); transparencyTiles = serializedObject.FindProperty("_transparencyTiles"); transparencyCull = serializedObject.FindProperty("_transparencyCull"); invertedMode = serializedObject.FindProperty("_invertedMode"); extruded = serializedObject.FindProperty("_extruded"); extrudeMultiplier = serializedObject.FindProperty("_extrudeMultiplier"); gradientIntensity = serializedObject.FindProperty("_gradientIntensity"); raycast3D = serializedObject.FindProperty("_raycast3D"); tileTextureSize = serializedObject.FindProperty("_tileTextureSize"); rotationShift = serializedObject.FindProperty("_rotationShift"); vrEnabled = serializedObject.FindProperty("_VREnabled"); enableGridEditor = serializedObject.FindProperty("_enableGridEditor"); wireframeColor = serializedObject.FindProperty("_wireframeColor"); wireframeColorFromTile = serializedObject.FindProperty("_wireframeColorFromTile"); wireframeIntensity = serializedObject.FindProperty("_wireframeIntensity"); defaultShadedColor = serializedObject.FindProperty("_defaultShadedColor"); tileTintColor = serializedObject.FindProperty("_tileTintColor"); lighting = serializedObject.FindProperty("_lighting"); ambientColor = serializedObject.FindProperty("_ambientColor"); receiveShadows = serializedObject.FindProperty("_receiveShadows"); highlightEnabled = serializedObject.FindProperty("_highlightEnabled"); highlightColor = serializedObject.FindProperty("_highlightColor"); highlightSpeed = serializedObject.FindProperty("_highlightSpeed"); rotationEnabled = serializedObject.FindProperty("_rotationEnabled"); rotationSpeed = serializedObject.FindProperty("_rotationSpeed"); rotationAxisAllowed = serializedObject.FindProperty("_rotationAxisAllowed"); rotationAxisVerticalThreshold = serializedObject.FindProperty("_rotationAxisVerticalThreshold"); rightClickRotates = serializedObject.FindProperty("_rightClickRotates"); reverseDragDirection = serializedObject.FindProperty("_reverseDragDirection"); rightClickRotatingClockwise = serializedObject.FindProperty("_rightClickRotatingClockwise"); rightButtonDrag = serializedObject.FindProperty("_rightButtonDrag"); zoomEnabled = serializedObject.FindProperty("_zoomEnabled"); zoomSpeed = serializedObject.FindProperty("_zoomSpeed"); zoomDamping = serializedObject.FindProperty("_zoomDamping"); zoomMinDistance = serializedObject.FindProperty("_zoomMinDistance"); zoomMaxDistance = serializedObject.FindProperty("_zoomMaxDistance"); pathFindingFormula = serializedObject.FindProperty("_pathFindingHeuristicFormula"); pathFindingSearchLimit = serializedObject.FindProperty("_pathFindingSearchLimit"); pathFindingUseExtrusion = serializedObject.FindProperty("_pathFindingUseExtrusion"); pathFindingExtrusionWeight = serializedObject.FindProperty("_pathFindingExtrusionWeight"); _headerTexture = Resources.Load <Texture2D> ("HexasphereEditorHeader"); blackBack = new GUIStyle(); blackBack.normal.background = MakeTex(4, 4, Color.black); sb = new StringBuilder(); hexa = (Hexasphere)target; if (hexa.tiles == null) { hexa.Init(); } divisions = hexa.numDivisions; colorSelection = new Color(1, 1, 0.5f, 0.85f); tileColor = Color.white; tileSelectedIndices = new List <int> (); HideEditorMesh(); }