Пример #1
0
    private void HandleEntity(Modifiers keyModifiers)
    {
        if (!this.CursorIsOverUIElement() && Input.GetMouseButtonDown(LEFT_CLICK) && !this.node.EntityExistsAtLocation(this.currentMouseGridPos))
        {
            FrEdLibrary.Type type = this.SelectedEntity.type;
            switch (type)
            {
            default:
                ButtEntity ent = new ButtEntity();
                ent.type = type;
                ent.Initialize();
                ent.pos = this.currentMouseGridPos;
                if (this.node.AddEntity(ent))
                {
                    this.node.CreateItem(ent);
                }
                break;

            case FrEdLibrary.Type.PlayerSpawn:

                break;
            }
        }
    }
Пример #2
0
    public int SetProperty(string label, string value)    //returns true if it's a prefab
    {
        switch (label)
        {
        case "prefab":
            int.TryParse(value, out this.prefabId);
            if (this.prefabId > 0)
            {
                return(1);
            }
            return(0);

        case "behaviour":
            int.TryParse(value, out this.behaviourId);
            if (this.behaviourId > 0)
            {
                return(2);
            }
            return(0);

        case "type": this.type = value.ToEnum <FrEdLibrary.Type>(); return(0);

        case "x": float.TryParse(value, out this.pos.x); return(0);

        case "y": float.TryParse(value, out this.pos.y); return(0);

        case "pos": this.pos = this.GetVec2(value); return(0);

        case "xScale": float.TryParse(value, out this.scale.x); return(0);

        case "yScale": float.TryParse(value, out this.scale.y); return(0);

        case "scale": this.scale = this.GetVec2(value); return(0);

        case "tilt": float.TryParse(value, out this.tilt); return(0);

        case "destinationLevel": this.destinationLevel = value; return(0);

        case "destinationButt": this.destinationButt = value; return(0);

        case "noSound": bool.TryParse(value, out this.noSound); return(0);

        case "createLate": float.TryParse(value, out this.createLate); return(0);

        case "int1": int.TryParse(value, out this.int1); return(0);

        case "easing": int.TryParse(value, out this.easing); return(0);

        case "speed": float.TryParse(value, out this.speed); return(0);

        case "lifespan": float.TryParse(value, out this.lifespan); return(0);

        case "ammo": int.TryParse(value, out this.ammoId); return(0);

        case "firingDelay": float.TryParse(value, out this.firingDelay); return(0);

        case "turningSpeed": float.TryParse(value, out this.turningSpeed); return(0);

        case "cameraState": this.cameraState = value.ToEnum <StateBasedCamera.stateTypes>(); return(0);

        case "nodePosX": float.TryParse(value, out this.nodePos.x); return(0);

        case "nodePosY": float.TryParse(value, out this.nodePos.y); return(0);

        case "nodePos": this.nodePos = this.GetVec2(value); return(0);

        case "track": float.TryParse(value, out this.track); return(0);

        case "minX": float.TryParse(value, out this.min.x); return(0);

        case "minY": float.TryParse(value, out this.min.y); return(0);

        case "min": this.min = this.GetVec2(value); return(0);

        case "maxX": float.TryParse(value, out this.max.x); return(0);

        case "maxY": float.TryParse(value, out this.max.y); return(0);

        case "max": this.max = this.GetVec2(value); return(0);

        case "ani": int.TryParse(value, out this.aniId); return(0);

        case "frame": this.frames.Add(this.GetFFrame(value)); return(0);

        case "checkFloor": bool.TryParse(value, out this.checkFloor); return(0);

        case "mesh": this.mesh = value.ToEnum <FrEdLibrary.MeshType>(); return(0);

        case "emissionPerSecond": float.TryParse(value, out this.emissionPerSecond); return(0);

        case "speedMin": float.TryParse(value, out this.startSpeedMin); return(0);

        case "speedMax": float.TryParse(value, out this.startSpeedMax); return(0);

        case "startSizeMin": float.TryParse(value, out this.startSizeMin); return(0);

        case "startSizeMax": float.TryParse(value, out this.startSizeMax); return(0);

        case "lifespanMin": float.TryParse(value, out this.startLifespanMin); return(0);

        case "lifespanMax": float.TryParse(value, out this.startLifespanMax); return(0);

        case "shape": this.shape = value.ToEnum <ParticleSystemShapeType>(); return(0);

        case "shapeScaleX": float.TryParse(value, out this.shapeScale.x); return(0);

        case "shapeScaleY": float.TryParse(value, out this.shapeScale.y); return(0);

        case "shapeScaleZ": float.TryParse(value, out this.shapeScale.z); return(0);

        case "shapeScale": this.shapeScale = this.GetVec3(value); return(0);

        case "colour1": this.color1 = this.GetColor(value); return(0);

        case "colour2": this.color2 = this.GetColor(value); return(0);

        case "color1": this.color1 = this.GetColor(value); return(0);

        case "color2": this.color2 = this.GetColor(value); return(0);

        case "skyBands": int.TryParse(value, out this.skyBands); return(0);

        case "alpha1": float.TryParse(value, out this.alpha1); return(0);

        case "alpha2": float.TryParse(value, out this.alpha2); return(0);

        case "alpha3": float.TryParse(value, out this.alpha3); return(0);

        case "alpha4": float.TryParse(value, out this.alpha4); return(0);

        case "alpha5": float.TryParse(value, out this.alpha5); return(0);

        case "rotationMin": float.TryParse(value, out this.rotationMin); return(0);

        case "rotationMax": float.TryParse(value, out this.rotationMax); return(0);
        }

        return(0);
    }