Esempio n. 1
0
 public MapObjectSphereObject(PositionAngleProvider posAngle, GetDimensions getDimensions, string name)
     : base()
 {
     this.posAngle      = posAngle;
     this.getDimensions = getDimensions;
     this.name          = name;
 }
 public MapObjectCylinderObject(PositionAngleProvider positionAngleProvider, GetDimensions getDimensions, string name)
     : base()
 {
     this.positionAngleProvider = positionAngleProvider;
     this.getDimensions         = getDimensions;
     this.name = name;
 }
        public static object CastToElement(this object param, object[] options)
        {
            object paramType = param.GetType().GetProperty("type").GetValue(param, null);

            if (paramType.GetType() != typeof(string))
            {
                return(null);
            }

            if (paramType.GetType() == typeof(string) && (string)paramType == "position" || (string)paramType == "rotation")
            {
                GetDimensions dimension = new GetDimensions(options);
                if (dimension.count == 1)
                {
                    return(null);//new Timeline.Core.TLVector1(dimension.x, (string)paramType);
                }
                else if (dimension.count == 2)
                {
                    return(new Timeline.Core.TLVector2(dimension.x, dimension.y, (string)paramType));
                }
                else if (dimension.count == 3)
                {
                    return(new Timeline.Core.TLVector3(dimension.x, dimension.y, dimension.z, (string)paramType));
                }
                else if (dimension.count == 4)
                {
                    return(null);//new Timeline.Core.TLVector4(dimension.x, dimension.y, dimension.z, dimension.w, (string)paramType);
                }
            }

            CheckGetFieldNamesValues type = new CheckGetFieldNamesValues(param, new string[] { "type" });

            CheckGetFieldNamesValues field = new CheckGetFieldNamesValues(param, new string[] { "value", "radius", "rotation", "alpha", "scale" });

            return(new Timeline.Core.TLElement(type.names[0], field.names, field.floats));
        }
Esempio n. 4
0
 // Use this for initialization
 void Awake()
 {
     DontDestroyOnLoad(transform.gameObject);
     refer = obj.GetComponent <GetDimensions>();
 }