public void chaseMe() { WitchLogic witchLogic = FindObjectOfType <GameManager>().getWitch().GetComponent <WitchLogic>(); witchLogic.chase(transform); changeMaterial(glowMaterial); setGlowing(true); // disable this player from shooting in SpawnLightOrb.cs }
public void stopChasingMe() { WitchLogic witchLogic = FindObjectOfType <GameManager>().getWitch().GetComponent <WitchLogic>(); witchLogic.stopChasing(); changeMaterial(ogMaterial); setGlowing(false); setHidden(false); }
// Start is called before the first frame update void Start() { witchLogic = GetComponentInParent <WitchLogic>(); //oscillator = GetComponent<Oscillator>(); lightComponent = GetComponent <Light>(); animator = GetComponent <Animator>(); if (animator == null) { animator = transform.parent.transform.GetComponent <Animator>(); } }
//OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { witchLogic = animator.GetComponent <WitchLogic>(); //witchLogic.playSound(witchLogic.idleSound); newVector = new Vector3(witchLogic.getWitchBase().position.x, animator.transform.position.y, witchLogic.getWitchBase().position.z); //Debug.Log("On State Enter: x - " + newVector.x + " z - " + newVector.z); direction = newVector - animator.transform.position; Debug.Log(direction); finishedRotating = false; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { witchLogic = animator.GetComponent <WitchLogic>(); //witchLogic.playSound(witchLogic.patrollingSound); patrolPositions = getRandomPositions(animator.transform); randomIndex = Random.Range(0, numOfPositions - 1); waitScript = animator.GetComponent <PatrolWait>(); counter = 0; isPausing = true; finishedRotating = false; waitScript.DoCoroutine(this); //pause direction = patrolPositions[randomIndex] - animator.transform.position; }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { waitScript = animator.GetComponent <CaptureWait>(); witchLogic = animator.GetComponent <WitchLogic>(); targetPlayer = witchLogic.getTargetPlayer(); targetPlayer.GetComponent <PlayerLogic>().gotCaught(); // make player disabled originalFruitDropTime = fruitDropTime; originalFruitLossRate = fruitLossRate; //goal = targetPlayer.GetComponent<PlayerLogic>().getFruitCounter() * 5; goal = getGoal(targetPlayer.GetComponent <PlayerLogic>().getFruitCounter()); dropTimer = fruitDropTime; gameManager = witchLogic.getGameManager(); Debug.Log("Witch Capture behaviour"); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { witchLogic = animator.GetComponent <WitchLogic>(); targetPlayer = witchLogic.getTargetPlayer(); }