コード例 #1
0
    void ColorWindDirection(MapLoc l)
    {
        GameObject go = Tiles[l];

        ResetTile(go);
        Color cb = Color.black;
        Color ct = Color.white;

        if (mapGen.Elevation[l.x, l.y] > mapGen.seaLevel)
        {
            cb = Color.white;
            ct = Color.black;
        }
        go.GetComponent <Renderer>().material.SetColor("_Color", cb);
        TextMesh tm = go.GetComponentInChildren <TextMesh>();

        if (tm != null)
        {
            tm.text  = '\u2192'.ToString();
            tm.color = ct;
            Vec   v  = mapGen.WindVector[l.x, l.y];
            float z  = 0f;
            float z2 = 90f;
            float d  = 0f;
            if (!v.Equals(null))
            {
                d  = MapUtil.VectorToRadians(v.x, v.y);
                d  = MapUtil.RadiansToDegrees(d);
                z  = 90f;
                z2 = 0f;
            }
            //Debug.Log("[" + l.x + "," + l.y + "] is ["+v.x+","+v.y+"]");
            tm.GetComponentInParent <Transform>().eulerAngles = new Vector3(z, d, z2);
        }
    }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (!(obj is OwnedLocation))
            {
                return(false);
            }
            var other = (OwnedLocation)obj;

            return(Owner.Equals(other.Owner) && Location.Equals(other.Location) && Value.Equals(other.Value) && Distance.Equals(other.Distance));
        }
コード例 #3
0
 public bool Equals(Rect other)
 {
     return(position.Equals(other.position) && size.Equals(other.size));
 }
コード例 #4
0
 public bool Equals(Line otherLine)
 {
     return(_startPt.Equals(otherLine.StartPoint) && _endPt.Equals(otherLine.EndPoint));
 }