private void Start() { stressScript = GetComponent <IStressable>(); worker = GetComponent <CoffeeWorker>(); worker.OnSpeedMultiplierChanged += ControllSystem; worker.OnWorkDone += SpawnAnnotation; worker.OnWorkDone += PlayWorkDoneSound; worker.OnWorkStarted += PlayWorkSound; stressScript.OnStressOut += PlayRageSound; }
// Start is called before the first frame update void Start() { canvasGroup = GetComponent <CanvasGroup>(); canvas = GetComponent <Canvas>(); cam = Camera.main; canvas.worldCamera = cam; stress = stressAbleObject.GetComponent <IStressable>(); rageSlider.maxValue = stress.MaxStress; stress.OnStressChanged += SetStressSliderValue; stress.OnStressChanged += StressValueChangedHandler; stress.OnStressChanged += SetStressBarColor; }
protected void Initialize() { moveScript = GetComponent <IMovable>(); stressScript = GetComponent <IStressable>(); GetRandomTexture(); }