protected override NewShipComponentOutput[] InnerProcess() { float ratio = inputs[0].amount; float speed = inputs[1].amount; animator.SetFloat(wasteRatioParamId, ratio); animator.SetFloat(speedParamId, speed); NewShipComponentOutput[] empty = new NewShipComponentOutput[0] { }; return(empty); }
protected override NewShipComponentOutput[] InnerProcess() { ElementTypes passType = inputs[0].type; float amount = inputs[0].amount; for (int i = 0; i < outputs.Length; i++) { NewShipComponentOutput output = outputs[i]; output.Set(passType, _distribution[i] * amount); } // Change animation params here return(outputs); }
protected void Awake() { _isProcessing = false; // Define inputs and outputs outputs = new NewShipComponentOutput[children.Length]; for (int i = 0; i < children.Length; i++) { NewShipComponent child = children[i]; outputs[i] = new NewShipComponentOutput(child); } ElementTypes[][] possibleInputTypes = DefineInputs(); inputs = new NewShipComponentInput[possibleInputTypes.Length]; for (int i = 0; i < possibleInputTypes.Length; i++) { inputs[i] = new NewShipComponentInput(possibleInputTypes[i]); } }
protected override NewShipComponentOutput[] InnerProcess() { ElementTypes passType = inputs[0].type; float amount = inputs[0].amount; for (int i = 0; i < outputs.Length; i++) { NewShipComponentOutput output = outputs[i]; output.Set(passType, _distribution[i] * amount); } string textualDistribution = ""; foreach (float percentage in _distribution) { textualDistribution += (int)(percentage * 100) + "% - "; } SetStatus("Distributing " + amount + " " + passType + " by " + // Removing the extra ' - ' from the distribution text textualDistribution.Substring(0, textualDistribution.Length - 3)); return(outputs); }