public override IEnumerator Execute(GameObject target, IAction[] actions, int index) { if (HookCamera.Instance != null) { if (HookCamera.Instance.gameObject.GetComponent <CameraColourSwitcher>() == null) { HookCamera.Instance.gameObject.AddComponent <CameraColourSwitcher>(); Debug.Log("Adding Camera Component"); yield return(new WaitForSeconds(0.5f)); } CameraColourSwitcher camswap = HookCamera.Instance.Get <CameraColourSwitcher>(); if (enableVariable == true) { camswap.swapping = (bool)this.swappingVariable.Get(target); } else { if (enableSwapping == true) { camswap.swapping = true; } else { camswap.swapping = false; } } } yield return(base.Execute(target, actions, index)); }
public override IEnumerator Execute(GameObject target, IAction[] actions, int index) { if (HookCamera.Instance != null) { if (HookCamera.Instance.gameObject.GetComponent <CameraColourSwitcher>() == null) { HookCamera.Instance.gameObject.AddComponent <CameraColourSwitcher>(); Debug.Log("Adding Camera Component"); yield return(new WaitForSeconds(0.5f)); } CameraColourSwitcher camswap = HookCamera.Instance.Get <CameraColourSwitcher>(); if (ColourSwitch1 == true) { camswap.switchColors[0].enabled = true; if (originalcolourVar1 == true) { camswap.switchColors[0].oldColor = (Color)this.originalColour1.Get(target); } else { camswap.switchColors[0].oldColor = _originalColour1; } if (newcolourVar1 == true) { camswap.switchColors[0].newColor = (Color)this.newColour1.Get(target); } else { camswap.switchColors[0].newColor = _newColour1; } if (toleranceVar1 == true) { camswap.switchColors[0].tolerance = (float)this.tolerance1.Get(target); } else { camswap.switchColors[0].tolerance = _tolerance1; } if (featherVar1 == true) { camswap.switchColors[0].feathering = (float)this.feathering1.Get(target); } else { camswap.switchColors[0].feathering = _feathering1; } } else { camswap.switchColors[0].enabled = false; camswap.switchColors[0].oldColor = Color.white; camswap.switchColors[0].newColor = Color.white; camswap.switchColors[0].tolerance = 0.0f; camswap.switchColors[0].feathering = 0.0f; } if (ColourSwitch2 == true) { camswap.switchColors[1].enabled = true; if (originalcolourVar2 == true) { camswap.switchColors[1].oldColor = (Color)this.originalColour2.Get(target); } else { camswap.switchColors[1].oldColor = _originalColour2; } if (newcolourVar2 == true) { camswap.switchColors[1].newColor = (Color)this.newColour2.Get(target); } else { camswap.switchColors[1].newColor = _newColour2; } if (toleranceVar2 == true) { camswap.switchColors[1].tolerance = (float)this.tolerance2.Get(target); } else { camswap.switchColors[1].tolerance = _tolerance2; } if (featherVar2 == true) { camswap.switchColors[1].feathering = (float)this.feathering2.Get(target); } else { camswap.switchColors[1].feathering = _feathering2; } } else { camswap.switchColors[1].enabled = false; camswap.switchColors[1].oldColor = Color.white; camswap.switchColors[1].newColor = Color.white; camswap.switchColors[1].tolerance = 0.0f; camswap.switchColors[1].feathering = 0.0f; } if (ColourSwitch3 == true) { camswap.switchColors[2].enabled = true; if (originalcolourVar3 == true) { camswap.switchColors[2].oldColor = (Color)this.originalColour3.Get(target); } else { camswap.switchColors[2].oldColor = _originalColour3; } if (newcolourVar3 == true) { camswap.switchColors[2].newColor = (Color)this.newColour3.Get(target); } else { camswap.switchColors[2].newColor = _newColour3; } if (toleranceVar3 == true) { camswap.switchColors[2].tolerance = (float)this.tolerance3.Get(target); } else { camswap.switchColors[2].tolerance = _tolerance3; } if (featherVar3 == true) { camswap.switchColors[2].feathering = (float)this.feathering3.Get(target); } else { camswap.switchColors[2].feathering = _feathering3; } } else { camswap.switchColors[2].enabled = false; camswap.switchColors[2].oldColor = Color.white; camswap.switchColors[2].newColor = Color.white; camswap.switchColors[2].tolerance = 0.0f; camswap.switchColors[2].feathering = 0.0f; } if (ColourSwitch4 == true) { camswap.switchColors[3].enabled = true; if (originalcolourVar4 == true) { camswap.switchColors[3].oldColor = (Color)this.originalColour4.Get(target); } else { camswap.switchColors[3].oldColor = _originalColour4; } if (newcolourVar4 == true) { camswap.switchColors[3].newColor = (Color)this.newColour4.Get(target); } else { camswap.switchColors[3].newColor = _newColour4; } if (toleranceVar4 == true) { camswap.switchColors[3].tolerance = (float)this.tolerance4.Get(target); } else { camswap.switchColors[3].tolerance = _tolerance4; } if (featherVar4 == true) { camswap.switchColors[3].feathering = (float)this.feathering4.Get(target); } else { camswap.switchColors[3].feathering = _feathering4; } } else { camswap.switchColors[3].enabled = false; camswap.switchColors[3].oldColor = Color.white; camswap.switchColors[3].newColor = Color.white; camswap.switchColors[3].tolerance = 0.0f; camswap.switchColors[3].feathering = 0.0f; } } yield return(base.Execute(target, actions, index)); }