Example #1
0
        public GameObject GetIslandVisualization(Island island)
        {
            var gb = gB.LoadViaResources("Island");

            this.ModelToEntity.modelToEntity.Add(gb, island);
            return(gb);
        }
 public GameObject GetElementView(IElementalType eType, int size)
 {
     var gO= gM.LoadViaResources("UnitElementBall");
     gO.GetComponent<Renderer>().material.color = eType.GetColor();
     gO.transform.localScale = gO.transform.localScale * (0.7f* Mathf.Sqrt(size));
     return gO;
 }
        public GameObject GetLight()
        {
            var obj   = gO.LoadViaResources("UnitLight");
            var light = obj.GetComponent <Light>();

            light.color = new Color(1, 1, 1);
            return(obj);
        }
Example #4
0
        internal GameObject GetTreeVisualization(int seed)
        {
            var side     = (seed % 2) > 0 ? "A" : "B";
            var treeNb   = 1 + (seed % 5);
            var treePath = useSimpleObjects ? "Tree" : ("Tree0" + treeNb + side);
            var gO       = gB.LoadViaResources(treePath);

            if (useSimpleObjects)
            {
                gO.transform.GetChild(0).gameObject.GetComponent <MeshRenderer>().material.color = brown;
                gO.transform.GetChild(1).gameObject.GetComponent <MeshRenderer>().material.color = Color.green;
            }
            if (!useSimpleObjects)
            {
                gO.transform.Rotate(new Vector3(0, 0, 1), seed % 360);
            }
            return(gO);
        }
        public void CreateViewForIslandElement(IslandElement element)
        {
            if (element == null)
            {
                return;
            }
            view = gameObjectManager.LoadViaResources("Inventory");

            updateContainingInventory();
        }
        private GameObject GetBarForStat(Color lowColor, Color neutralColor, Color highColor, float value, float maxValue)
        {
            float positiveValue = Mathf.Max(Mathf.Min(1f, value / (maxValue)), 0);
            float negativeValue = 1.0001f - positiveValue;

            var barPositive = gB.LoadViaResources("Bar");
            var barNegative = gB.LoadViaResources("Bar");
            var barHolder   = gB.LoadViaResources("BarHolder");

            barPositive.GetComponent <Renderer>().material.color = Color.Lerp(neutralColor, highColor, positiveValue * 0.95f);
            barNegative.GetComponent <Renderer>().material.color = Color.Lerp(neutralColor, lowColor, negativeValue * 0.95f);
            barPositive.transform.SetParent(barHolder.transform);
            var size = 2f;

            barPositive.transform.localScale    = size * new Vector3(positiveValue, 0.1f, 0.1f);
            barNegative.transform.localScale    = size * new Vector3(negativeValue, 0.1f, 0.1f);
            barNegative.transform.localPosition = size * new Vector3(positiveValue / 2f, 0, 0);
            barPositive.transform.localPosition = size * new Vector3(-(negativeValue / 2f), 0f, 0f);
            barNegative.transform.SetParent(barHolder.transform);
            return(barHolder);
        }
Example #7
0
 public Minimap(TopDownCircleSpaceIndex TopdownIslandIndex, FollowCamera toFollow)
 {
     this.TopdownIslandIndex = TopdownIslandIndex;
     this.toFollow           = toFollow;
     minimapBase             = gOM.LoadViaResources("MinimapBase");
 }