本文整理汇总了C#中Effects.add方法的典型用法代码示例。如果您正苦于以下问题:C# Effects.add方法的具体用法?C# Effects.add怎么用?C# Effects.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Effects
的用法示例。
在下文中一共展示了Effects.add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Interacted
public InteractuableResult Interacted(RaycastHit hit = new RaycastHit())
{
InteractuableResult ret = InteractuableResult.IGNORES;
if (interactable) {
if (Element.isReturnsWhenDragged ()) {
switch (((Item)Element).getBehaviour ()) {
case Item.BehaviourType.FIRST_ACTION:
foreach (Action a in Element.getActions()) {
if (ConditionChecker.check (a.getConditions ())) {
Game.Instance.Execute (new EffectHolder (a.getEffects ()));
break;
}
}
ret = InteractuableResult.DOES_SOMETHING;
break;
case Item.BehaviourType.NORMAL:
List<Action> available = new List<Action> ();
foreach (Action a in Element.getActions()) {
if (ConditionChecker.check (a.getConditions ())) {
bool addaction = true;
foreach (Action a2 in available) {
if ((a.getType () == Action.CUSTOM || a.getType () == Action.CUSTOM_INTERACT) && (a2.getType () == Action.CUSTOM || a2.getType () == Action.CUSTOM_INTERACT)) {
if (((CustomAction)a).getName () == ((CustomAction)a2).getName ()) {
addaction = false;
break;
}
} else if (a.getType () == a2.getType ()) {
addaction = false;
break;
}
}
if (addaction)
available.Add (a);
}
}
//We check if it's an examine action, otherwise we create one and add it
bool addexamine = true;
foreach (Action a in available) {
if (a.getType () == Action.EXAMINE) {
addexamine = false;
break;
}
}
if (addexamine) {
Action ex = new Action (Action.EXAMINE);
Effects exeff = new Effects ();
exeff.add (new SpeakPlayerEffect (Element.getDescription (0).getDetailedDescription ()));
ex.setEffects (exeff);
available.Add (ex);
}
//if there is an action, we show them
if (available.Count > 0) {
Game.Instance.showActions (available, Input.mousePosition);
ret = InteractuableResult.DOES_SOMETHING;
}
break;
case Item.BehaviourType.ATREZZO:
default:
ret = InteractuableResult.IGNORES;
break;
}
} else {
if (drag == null) {
foreach (Action action in Element.getActions()) {
if (action.getType () == Action.DRAG_TO) {
drag = action;
break;
}
}
}
if (ConditionChecker.check (drag.getConditions ())) {
dragging = true;
ret = InteractuableResult.DOES_SOMETHING;
}
}
}
return ret;
}
示例2: Interacted
public InteractuableResult Interacted(RaycastHit hit = new RaycastHit())
{
InteractuableResult ret = InteractuableResult.IGNORES;
if (aad.getInfluenceArea () != null) {
}
switch(aad.getBehaviour()) {
case Item.BehaviourType.FIRST_ACTION:
foreach (Action a in aad.getActions()) {
if (ConditionChecker.check (a.getConditions ())) {
Game.Instance.Execute (new EffectHolder(a.getEffects()));
break;
}
}
ret = InteractuableResult.DOES_SOMETHING;
break;
case Item.BehaviourType.NORMAL:
List<Action> available = new List<Action> ();
foreach (Action a in aad.getActions()) {
if (ConditionChecker.check (a.getConditions ())) {
bool addaction = true;
foreach (Action a2 in available) {
if ((a.getType () == Action.CUSTOM || a.getType () == Action.CUSTOM_INTERACT) && (a2.getType () == Action.CUSTOM || a2.getType () == Action.CUSTOM_INTERACT)) {
if (((CustomAction)a).getName () == ((CustomAction)a2).getName ()) {
addaction = false;
break;
}
} else if (a.getType () == a2.getType ()) {
addaction = false;
break;
}
}
if (addaction)
available.Add (a);
}
}
//We check if it's an examine action, otherwise we create one and add it
bool addexamine = true;
string desc = aad.getDescription (0).getDetailedDescription ();
if (desc != "") {
foreach (Action a in available) {
if (a.getType () == Action.EXAMINE) {
addexamine = false;
break;
}
}
if (addexamine) {
Action ex = new Action (Action.EXAMINE);
Effects exeff = new Effects ();
exeff.add (new SpeakPlayerEffect (desc));
ex.setEffects (exeff);
available.Add (ex);
}
}
if (available.Count > 0) {
Game.Instance.showActions (available, Input.mousePosition);
ret = InteractuableResult.DOES_SOMETHING;
}
break;
case Item.BehaviourType.ATREZZO:
default:
ret = InteractuableResult.IGNORES;
break;
}
return ret;
}