//randomly assign a symbol sprite to the targetInput object public void ActivateTarget() { audioSource.Play(); int randomIndex = Random.Range(0, symbols.Length); currentSymbol.sprite = symbols[randomIndex]; if (randomIndex == 0) { _targetInput = TargetInput.Left; } else if (randomIndex == 1) { _targetInput = TargetInput.Middle; } if (randomIndex == 2) { _targetInput = TargetInput.Right; } currentSymbol.enabled = true; _leftPlayerInputActive = true; _rightPlayerInputActive = true; buttonController.InputActive = true; EnableLeftPlayerButtons(); EnableRightPlayerButtons(); inputActive = true; }
private void Init() { //_selectorNode = new SelectorNode(); //_selectorNode = new SequenceNode(); _selectorNode = new ParallelNode(); ParallelNode _subParallel = new ParallelNode(); _actionAtk = new ActionAtk(); _actionAtk.SetPreCondition(new ActionAtkPreCondition()); _selectorNode.AddChild(new ActionIdle()); _selectorNode.AddChild(_actionAtk); TargetInput _input = new TargetInput(); _input.Target = GlobalData.hero.MyEnity; _input.state = 1; _selectorNode.RunNode(_input); GameInput.Instance.OnUpdate += _selectorNode.Update; }