protected ShaderProp(string name, PropKey key, int id, ValType valType) {
     this.name = name;
     this.key = key;
     this.keyName = key.ToString();
     this.propId = id;
     Init(valType);
 }
        public ShaderPropColor(string name, PropKey key, int id, ColorType colType, bool composition = false, Keyword k = Keyword.NONE) : base(name, key, id, ValType.Color)
        {
            colorType = colType;
            Keyword   = k;

            this.composition = composition;
        }
 protected ShaderProp(PropKey key, ValType valType) {
     this.key = key;
     this.keyName = key.ToString();
     this.name = keyName.Substring(1);
     this.propId = Shader.PropertyToID(keyName);
     Init(valType);
 }
예제 #4
0
 protected ShaderProp(string name, PropKey key, int id, ValType valType)
 {
     this.name    = name;
     this.key     = key;
     this.keyName = key.ToString();
     this.propId  = id;
     Init(valType);
 }
예제 #5
0
 protected ShaderProp(PropKey key, ValType valType)
 {
     this.key     = key;
     this.keyName = key.ToString();
     this.name    = keyName.Substring(1);
     this.propId  = Shader.PropertyToID(keyName);
     Init(valType);
 }
 public ShaderPropFloat(PropKey key, EditRange range, float[] sliderRange,
                           bool[] opts, float defaultVal, params float[] presetVals) : base(key, ValType.Float) {
     this.range = range;
     this.sliderMin = sliderRange[0];
     this.sliderMax = sliderRange[1];
     this.opts = opts;
     this.presetVals = presetVals;
     this.defaultVal = defaultVal;
 }
 protected ACCTexture(string propName) {
     this.propName = propName;
     this.propKey = (PropKey)Enum.Parse(typeof(PropKey), propName);
     if (propKey == PropKey._ToonRamp) {
         toonType = RAMP;
     } else if (propKey == PropKey._ShadowRateToon) {
         toonType = SHADOW_RATE;
     }
 }
예제 #8
0
 public ShaderPropFloat(PropKey key, EditRange range, float[] sliderRange,
                        PresetOperation[] opts, float defaultVal, params float[] presetVals) : base(key, ValType.Float)
 {
     this.range      = range;
     this.sliderMin  = sliderRange[0];
     this.sliderMax  = sliderRange[1];
     this.opts       = opts;
     this.presetVals = presetVals;
     this.defaultVal = defaultVal;
 }
        private ACCTexture(PropKey propKey) {
            this.propKey = propKey;
            this.propName = propKey.ToString();

            if (propKey == PropKey._ToonRamp) {
                toonType = RAMP;
            } else if (propKey == PropKey._ShadowRateToon) {
                toonType = SHADOW_RATE;
            }
        }
 public ShaderPropFloat(PropKey key, Keyword kwd, EditRange <float> range, IList <float> sliderRange,
                        PresetOperation[] opts, float defaultVal, params float[] presetVals) : base(key, ValType.Float)
 {
     this.range      = range;
     keyword         = kwd;
     sliderMin       = sliderRange[0];
     sliderMax       = sliderRange[1];
     this.opts       = opts;
     this.presetVals = presetVals;
     this.defaultVal = defaultVal;
 }
 protected ACCTexture(string propName)
 {
     this.propName = propName;
     this.propKey  = (PropKey)Enum.Parse(typeof(PropKey), propName);
     if (propKey == PropKey._ToonRamp)
     {
         toonType = RAMP;
     }
     else if (propKey == PropKey._ShadowRateToon)
     {
         toonType = SHADOW_RATE;
     }
 }
        private ACCTexture(PropKey propKey)
        {
            this.propKey  = propKey;
            this.propName = propKey.ToString();

            if (propKey == PropKey._ToonRamp)
            {
                toonType = RAMP;
            }
            else if (propKey == PropKey._ShadowRateToon)
            {
                toonType = SHADOW_RATE;
            }
        }
//        public ACCTexture(Material mate, string propName, MaterialType type) :this(propName) {
//            this.type = type;
//            this.tex = mate.GetTexture(propName);
//
//            if (tex != null) {
//                this.editname = tex.name;
//                if (tex is Texture2D) {
//                   texOffset = mate.GetTextureOffset(propName);
//                   texScale  = mate.GetTextureScale(propName);
//                } else {
//                    LogUtil.DebugF("propName({0}): texture type:{1}", propName, tex.GetType());
//                }
//            } else {
//                // シェーダ切り替えなどで、元々存在しないテクスチャの場合
//                LogUtil.DebugF("texture not found. propname={0}, material={1}", propName, mate.name);
//                // 空のテクスチャは作成しない
////                this.tex = new Texture2D(2, 2);
////                this.tex.name = string.Empty;
////                // テクスチャを追加セット
////                mate.SetTexture(propName, this.tex);
//            }
//        }

        public ACCTexture(ACCTexture src)
        {
            this.original = src;
            this.propName = src.propName;
            this.type     = src.type;
            this.prop     = src.prop;
            this.propKey  = src.propKey;

            this.editname  = src.editname;
            this.filepath  = src.filepath;
            this.texOffset = src.texOffset;
            this.texScale  = src.texScale;

            this.toonType = src.toonType;
        }
        public ACCTexture(ACCTexture src)
        {
            original = src;
            propName = src.propName;
            type     = src.type;
            prop     = src.prop;
            propKey  = src.propKey;

            editname  = src.editname;
            filepath  = src.filepath;
            texOffset = src.texOffset;
            texScale  = src.texScale;

            toonType = src.toonType;
        }
        protected ACCTexture(string propName)
        {
            this.propName = propName;
            propKey       = (PropKey)Enum.Parse(typeof(PropKey), propName);
            switch (propKey)
            {
            case PropKey._ToonRamp:
            case PropKey._OutlineToonRamp:
                toonType = RAMP;
                break;

            case PropKey._ShadowRateToon:
                toonType = SHADOW_RATE;
                break;
            }
        }
        private ACCTexture(PropKey propKey)
        {
            this.propKey = propKey;
            propName     = propKey.ToString();

            switch (propKey)
            {
            case PropKey._ToonRamp:
            case PropKey._OutlineToonRamp:
                toonType = RAMP;
                break;

            case PropKey._ShadowRateToon:
                toonType = SHADOW_RATE;
                break;
            }
        }
        // Token: 0x0600018D RID: 397 RVA: 0x0000E6B0 File Offset: 0x0000C8B0
        private ACCTexture(PropKey propKey)
        {
            this.propKey  = propKey;
            this.propName = propKey.ToString();
            switch (propKey)
            {
            case PropKey._ToonRamp:
            case PropKey._OutlineToonRamp:
                this.toonType = 1;
                return;

            case PropKey._ShadowTex:
            case PropKey._OutlineTex:
                break;

            case PropKey._ShadowRateToon:
                this.toonType = 2;
                break;

            default:
                return;
            }
        }
예제 #18
0
 public ShaderPropBool(string name, PropKey key, int id) : base(name, key, id, ValType.Bool)
 {
     range = EditRange.boolVal;
 }
예제 #19
0
 public ShaderPropFloat(PropKey key, ValType valType) : base(key, valType)
 {
 }
 public ShaderPropColor(PropKey key, ColorType colType) : base(key, ValType.Color) {
     this.colorType = colType;
 }
//        public ACCTexture(Material mate, string propName, MaterialType type) :this(propName) {
//            this.type = type;
//            this.tex = mate.GetTexture(propName);
//
//            if (tex != null) {
//                this.editname = tex.name;
//                if (tex is Texture2D) {
//                   texOffset = mate.GetTextureOffset(propName);
//                   texScale  = mate.GetTextureScale(propName);
//                } else {
//                    LogUtil.DebugF("propName({0}): texture type:{1}", propName, tex.GetType());
//                }
//            } else {
//                // シェーダ切り替えなどで、元々存在しないテクスチャの場合
//                LogUtil.DebugF("texture not found. propname={0}, material={1}", propName, mate.name);
//                // 空のテクスチャは作成しない
////                this.tex = new Texture2D(2, 2);
////                this.tex.name = string.Empty;
////                // テクスチャを追加セット
////                mate.SetTexture(propName, this.tex);
//            }
//        }

        public ACCTexture(ACCTexture src) {
            this.original  = src;
            this.propName  = src.propName;
            this.type      = src.type;
            this.prop      = src.prop;
            this.propKey   = src.propKey;

            this.editname  = src.editname;
            this.filepath  = src.filepath;
            this.texOffset = src.texOffset;
            this.texScale  = src.texScale;

            this.toonType  = src.toonType;
        }
예제 #22
0
 public ShaderPropFloat(PropKey key) : base(key, ValType.Float)
 {
 }
예제 #23
0
 public ShaderPropColor(string name, PropKey key, int id, ColorType colType) : base(name, key, id, ValType.Color)
 {
     this.colorType = colType;
 }
예제 #24
0
 public ShaderPropTex(string name, PropKey key, int id, TexType type) : base(name, key, id, ValType.Tex)
 {
     this.texType = type;
 }
 // テクスチャエディット対象を無効にする
 public void Clear() {
     slotName = string.Empty;
     matNo = -1;
     propName = string.Empty;
     propKey = PropKey.Unkown;
 }
 protected ShaderPropFloat(string name, PropKey key, int id, ValType valType) : base(name, key, id, valType) { }
예제 #27
0
        public void LoadData()
        {
            //defultt values
            m_aPropKeys = new List<PropKey>();

            BitConverter.IsLittleEndian = true;
            List<PropertyReader.Property> props = PropertyReader.getPropList(pcc, pcc.Exports[index].Data);
            string name;
            foreach (PropertyReader.Property p in props)
            {
                if (pcc.getNameEntry(p.Name) == "m_aPropKeys")
                {
                    int pos = 28;
                    int count = BitConverter.ToInt32(p.raw, 24);
                    for (int j = 0; j < count; j++)
                    {
                        List<PropertyReader.Property> p2 = PropertyReader.ReadProp(pcc, p.raw, pos);
                        PropKey key = new PropKey();
                        for (int i = 0; i < p2.Count(); i++)
                        {
                            name = pcc.getNameEntry(p2[i].Name);
                            if (name == "pWeaponClass")
                                key.pWeaponClass = p2[i].Value.IntValue;
                            else if (name == "nmProp")
                                key.nmProp = p2[i].Value.NameValue;
                            else if (name == "nmAction")
                                key.nmAction = p2[i].Value.NameValue;
                            else if (name == "pPropMesh")
                                key.pPropMesh = p2[i].Value.IntValue;
                            else if (name == "pActionPartSys")
                                key.pActionPartSys = p2[i].Value.IntValue;
                            else if (name == "pActionClientEffect")
                                key.pActionClientEffect = p2[i].Value.IntValue;
                            else if (name == "bEquip")
                                key.bEquip = p2[i].Value.IntValue != 0;
                            else if (name == "bForceGenericWeapon")
                                key.bForceGenericWeapon = p2[i].Value.IntValue != 0;
                            pos += p2[i].raw.Length;
                        }
                        m_aPropKeys.Add(key);
                    }
                }
            }
        }
    //	static Dictionary<Type, ContextPropertySwitchInterpreter> switchesByType = new Dictionary<Type, ContextPropertySwitchInterpreter> ();
    //
    //	public static ContextPropertySwitchInterpreter GetSwitch (Type t)
    //	{
    //		ContextPropertySwitchInterpreter inter = null;
    //		if (!switchesByType.TryGetValue (t, out inter))
    //		{
    //
    //
    //		}
    //		return inter;
    //	}

    public ContextPropertySwitchInterpreter(string propName, Type type, ScriptEngine engine) : base(propName, type, engine)
    {
        engine.GetPlugin <ContextSwitchesPlugin> ().AddInterToType(type, this);
        this.propName = propName;
        propType      = type;
        this.Engine   = engine;
        // if (ScriptEngine.AnalyzeDebug)
        //      Debug.Log ("Context switch " + type);
        var props   = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
        var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
        // if (ScriptEngine.AnalyzeDebug)
        //     Debug.Log ("Methods count " + methods.Length);
        var thisKey = new PropKey(type, propName);

        if (!allPropSwitches.ContainsKey(thisKey))
        {
            allPropSwitches.Add(thisKey, this);
        }
        if (typeof(MonoBehaviour).IsAssignableFrom(type) && type != typeof(MonoBehaviour))
        {
            //if (ScriptEngine.AnalyzeDebug)
            //    Debug.Log ("It's a component! " + type);
            foreach (var prop in props)
            {
                //Debug.Log (prop.Name);
                if (prop.PropertyType != typeof(string) && (prop.PropertyType.IsClass || (prop.PropertyType.IsValueType && !prop.PropertyType.IsEnum &&
                                                                                          prop.PropertyType != typeof(bool) && prop.PropertyType != typeof(float) && prop.PropertyType != typeof(int))))
                {
                    var key = new PropKey(prop.PropertyType, prop.Name);
                    if (allPropSwitches.ContainsKey(key))
                    {
                        contextSwitches.Add(NameTranslator.ScriptNameFromCSharp(prop.Name), allPropSwitches [key]);
                    }
                    else
                    {
                        ContextPropertySwitchInterpreter inter = new ContextPropertySwitchInterpreter(prop.Name, prop.PropertyType, engine);
                        contextSwitches.Add(NameTranslator.ScriptNameFromCSharp(prop.Name), inter);

                        inter.Engine = Engine;
                    }

                    // if (ScriptEngine.AnalyzeDebug)
                    //      Debug.Log ("SubContext " + NameTranslator.ScriptNameFromCSharp (prop.Name));
                }
                else
                {
                    ContextPropertyInterpreter inter = new ContextPropertyInterpreter(prop.Name, prop.PropertyType, engine);
                    inter.Engine = Engine;
                    //  if (ScriptEngine.AnalyzeDebug)
                    //      Debug.Log (inter.Engine);
                    properties.Add(NameTranslator.ScriptNameFromCSharp(prop.Name), inter);
                    //   if (ScriptEngine.AnalyzeDebug)
                    //      Debug.Log (NameTranslator.ScriptNameFromCSharp (prop.Name));
                }
            }

            foreach (var method in methods)
            {
                if (method.GetCustomAttributes(typeof(CompilerGeneratedAttribute), false).Length > 0)
                {
                    continue;
                }
                // if (ScriptEngine.AnalyzeDebug)
                //    Debug.Log ("Context method " + method.Name);
                ContextFunctionCallInterpreter inter = new ContextFunctionCallInterpreter(method, Engine);
                functions.Add(NameTranslator.ScriptNameFromCSharp(method.Name), inter);
            }
        }
    }
 // Token: 0x060001F3 RID: 499 RVA: 0x0001160D File Offset: 0x0000F80D
 public ShaderPropTex(PropKey key, TexType type, Keyword k = Keyword.NONE) : base(key, ValType.Tex)
 {
     this.texType = type;
     base.Keyword = k;
 }
 public ShaderPropTex(PropKey key, TexType type) : base(key, ValType.Tex) {
     this.texType = type;
 }
 public ShaderPropTex(string name, PropKey key, int id, TexType type) : base(name, key, id, ValType.Tex) {
     this.texType = type;
 }
예제 #32
0
 public ShaderPropBool(PropKey key) : base(key, ValType.Bool)
 {
     range = EditRange.boolVal;
 }
 public ShaderPropFloat(PropKey key, ValType valType) : base(key, valType) { }
예제 #34
0
 // Token: 0x060001E5 RID: 485 RVA: 0x00011440 File Offset: 0x0000F640
 public ShaderPropFloat(PropKey key, Keyword kwd, string format, IList <float> range, PresetOperation[] opts, float defaultVal, params float[] presetVals) : this(key, kwd, new EditRange <float>(format, range[2], range[3]), range, opts, defaultVal, presetVals)
 {
 }
 public ShaderPropFloat(PropKey key, string format, float[] range,
                           bool[] opts, float defaultVal, params float[] presetVals) 
     : this(key, new EditRange(format, range[2], range[3]), range, opts, defaultVal, presetVals) {
 }
예제 #36
0
 public ShaderPropColor(PropKey key, ColorType colType) : base(key, ValType.Color)
 {
     this.colorType = colType;
 }
예제 #37
0
 // Token: 0x060001E6 RID: 486 RVA: 0x00011468 File Offset: 0x0000F668
 public ShaderPropFloat(PropKey key, EditRange <float> range, IList <float> sliderRange, PresetOperation[] opts, float defaultVal, params float[] presetVals) : this(key, Keyword.NONE, range, sliderRange, opts, defaultVal, presetVals)
 {
 }
예제 #38
0
 public ShaderPropTex(PropKey key, TexType type) : base(key, ValType.Tex)
 {
     this.texType = type;
 }
 public ShaderPropBool(string name, PropKey key, int id) : base(name, key, id, ValType.Bool) {
     range = EditRange.boolVal;
 }
예제 #40
0
 public ShaderPropFloat(string name, PropKey key, int id) : base(name, key, id, ValType.Float)
 {
 }
 public ShaderPropBool(PropKey key) : base(key, ValType.Bool) {
     range = EditRange.boolVal;
 }
예제 #42
0
 protected ShaderPropFloat(string name, PropKey key, int id, ValType valType) : base(name, key, id, valType)
 {
 }
 public ShaderPropColor(string name, PropKey key, int id, ColorType colType) : base(name, key, id, ValType.Color) {
     this.colorType = colType;
 }
예제 #44
0
 public ShaderPropFloat(PropKey key, string format, float[] range,
                        PresetOperation[] opts, float defaultVal, params float[] presetVals)
     : this(key, new EditRange(format, range[2], range[3]), range, opts, defaultVal, presetVals)
 {
 }
 // Token: 0x060001F2 RID: 498 RVA: 0x000115F1 File Offset: 0x0000F7F1
 public ShaderPropTex(string name, PropKey key, int id, TexType type, Keyword k = Keyword.NONE) : base(name, key, id, ValType.Tex)
 {
     this.texType = type;
     base.Keyword = k;
 }
        // Token: 0x06000206 RID: 518 RVA: 0x00012FE4 File Offset: 0x000111E4
        public ShaderProp GetShaderProp(string propName)
        {
            try
            {
                PropKey propKey = (PropKey)Enum.Parse(typeof(PropKey), propName);
                switch (propKey)
                {
                case PropKey._MainTex:
                case PropKey._ToonRamp:
                case PropKey._ShadowTex:
                case PropKey._ShadowRateToon:
                case PropKey._OutlineTex:
                case PropKey._OutlineToonRamp:
                case PropKey._HiTex:
                case PropKey._RenderTex:
                case PropKey._BumpMap:
                case PropKey._SpecularTex:
                case PropKey._DecalTex:
                case PropKey._Detail:
                case PropKey._DetailTex:
                case PropKey._AnisoTex:
                case PropKey._ParallaxMap:
                case PropKey._Illum:
                case PropKey._Cube:
                case PropKey._ReflectionTex:
                case PropKey._MultiColTex:
                case PropKey._EnvMap:
                    foreach (ShaderPropTex shaderPropTex in this.texProps)
                    {
                        if (shaderPropTex.key == propKey)
                        {
                            return(shaderPropTex);
                        }
                    }
                    break;

                case PropKey._Color:
                case PropKey._ShadowColor:
                case PropKey._RimColor:
                case PropKey._OutlineColor:
                case PropKey._SpecColor:
                case PropKey._ReflectColor:
                case PropKey._EmissionColor:
                    foreach (ShaderPropColor shaderPropColor in this.colProps)
                    {
                        if (shaderPropColor.key == propKey)
                        {
                            return(shaderPropColor);
                        }
                    }
                    break;

                case PropKey._Shininess:
                case PropKey._OutlineWidth:
                case PropKey._RimPower:
                case PropKey._RimShift:
                case PropKey._HiRate:
                case PropKey._HiPow:
                case PropKey._FloatValue1:
                case PropKey._FloatValue2:
                case PropKey._FloatValue3:
                case PropKey._Parallax:
                case PropKey._Cutoff:
                case PropKey._Cutout:
                case PropKey._EmissionLM:
                case PropKey._UseMulticolTex:
                case PropKey._Strength:
                case PropKey._StencilComp:
                case PropKey._Stencil:
                case PropKey._StencilOp:
                case PropKey._StencilWriteMask:
                case PropKey._StencilReadMask:
                case PropKey._ColorMask:
                case PropKey._EnvAlpha:
                case PropKey._EnvAdd:
                case PropKey._ZTest:
                case PropKey._ZTest2:
                case PropKey._ZTest2Alpha:
                    foreach (ShaderPropFloat shaderPropFloat in this.fProps)
                    {
                        if (shaderPropFloat.key == propKey)
                        {
                            return(shaderPropFloat);
                        }
                    }
                    break;

                case PropKey._SetManualRenderQueue:
                    return(ShaderPropType.RenderQueue);
                }
            }
            catch
            {
            }
            return(null);
        }
 public ShaderPropFloat(string name, PropKey key, int id) : base(name, key, id, ValType.Float) { }
 // Token: 0x060001F0 RID: 496 RVA: 0x000115C2 File Offset: 0x0000F7C2
 public ShaderPropColor(PropKey key, ColorType colType, bool composition = false, Keyword k = Keyword.NONE) : base(key, ValType.Color)
 {
     this.colorType   = colType;
     base.Keyword     = k;
     this.composition = composition;
 }
 public ShaderPropFloat(PropKey key) : base(key, ValType.Float) { }