コード例 #1
0
ファイル: ActionNode.cs プロジェクト: Oplkill/WorldSmith
        public void PinConnected(NodeItem fromConnect, string property)
        {
            Type t = DotaAction.GetType();
            var prop = t.GetProperty(property);

            if (prop == null)
            {
                throw new ArgumentException("Property must be a valid KV property");
            }
            if(fromConnect.Node is VariableNode)
            {
                if (prop.PropertyType == typeof(NumberValue))
                {
                    var vn = fromConnect.Node as VariableNode;
                    var nv = new NumberValue("%" + vn.Variable.Name);

                    prop.SetMethod.Invoke(DotaAction, new object[] { nv });

                }
            }
            if(fromConnect is TargetNodeItem)
            {
                if(prop.PropertyType == typeof(TargetKey))
                {
                    var target = (fromConnect as TargetNodeItem).Target;

                    prop.SetMethod.Invoke(DotaAction, new object[] { target });

                }
            }

        }
コード例 #2
0
ファイル: TargetKey.cs プロジェクト: hex6/WorldSmith
 public TargetKey()
 {
     Preset = PresetType.TARGET;
     Center = PresetType.TARGET;
     Radius = new NumberValue("");
     Length = new NumberValue("");
     Thickness = new NumberValue("");
     Teams = AbilityUnitTargetTeamFlags.DOTA_UNIT_TARGET_TEAM_ENEMY;
     UnitTypes = AbilityUnitTargetTypeFlags.DOTA_UNIT_TARGET_NONE;
     Flags = AbilityUnitTargetFlags.DOTA_UNIT_TARGET_FLAG_NONE;
     MaxTargets = new NumberValue("-1");
     Random = new NumberValue("");
 }
コード例 #3
0
 public TargetKey()
 {
     Preset     = PresetType.TARGET;
     Center     = PresetType.TARGET;
     Radius     = new NumberValue("");
     Length     = new NumberValue("");
     Thickness  = new NumberValue("");
     Teams      = AbilityUnitTargetTeamFlags.DOTA_UNIT_TARGET_TEAM_ENEMY;
     UnitTypes  = AbilityUnitTargetTypeFlags.DOTA_UNIT_TARGET_NONE;
     Flags      = AbilityUnitTargetFlags.DOTA_UNIT_TARGET_FLAG_NONE;
     MaxTargets = new NumberValue("-1");
     Random     = new NumberValue("");
 }