private Vector3 GoalkeeperAction(String goalkeeperHorizontal, String goalkeeperVertical) { Vector3 saveVector = Vector3.zero; if (Input.GetAxis(goalkeeperHorizontal) > 0.0f && InputMgr.GetProperVerticalValue(goalkeeperVertical) >= 0.0f) { saveVector = new Vector3(1.5f, 1.3f, 0); wallCollider.enabled = true; } if (Input.GetAxis(goalkeeperHorizontal) > 0.0f && InputMgr.GetProperVerticalValue(goalkeeperVertical) < 0.0f) { saveVector = new Vector3(2, 0.3f, 0); wallCollider.enabled = true; } if (Input.GetAxis(goalkeeperHorizontal) < 0.0f && InputMgr.GetProperVerticalValue(goalkeeperVertical) >= 0.0f) { saveVector = new Vector3(-1.5f, 1.3f, 0); wallCollider.enabled = true; } if (Input.GetAxis(goalkeeperHorizontal) < 0.0f && InputMgr.GetProperVerticalValue(goalkeeperVertical) < 0.0f) { saveVector = new Vector3(-2, 0.3f, 0); wallCollider.enabled = true; } if (Input.GetAxis(goalkeeperHorizontal) == 0.0f && InputMgr.GetProperVerticalValue(goalkeeperVertical) > 0.0f) { saveVector = Vector3.up; } return(saveVector); }
private Vector3 FootballerAction(String footballerHorizontal, String footballerVertical, float missedShot) { Vector3 shotVector = Vector3.forward; if (Input.GetAxis(footballerHorizontal) > 0.0f && InputMgr.GetProperVerticalValue(footballerVertical) >= 0.0f) { shotVector = new Vector3(xShotFactor + missedShot, yShotFactor + missedShot, 1.0f); } if (Input.GetAxis(footballerHorizontal) > 0.0f && InputMgr.GetProperVerticalValue(footballerVertical) < 0.0f) { shotVector = new Vector3(xShotFactor + missedShot, 0, 1.0f); } if (Input.GetAxis(footballerHorizontal) < 0.0f && InputMgr.GetProperVerticalValue(footballerVertical) >= 0.0f) { shotVector = new Vector3(-xShotFactor - missedShot, yShotFactor + missedShot, 1.0f); } if (Input.GetAxis(footballerHorizontal) < 0.0f && InputMgr.GetProperVerticalValue(footballerVertical) < 0.0f) { shotVector = new Vector3(-xShotFactor - missedShot, 0, 1.0f); } if (Input.GetAxis(footballerHorizontal) == 0.0f && InputMgr.GetProperVerticalValue(footballerVertical) > 0.0f) { shotVector = new Vector3(0, yShotFactor + missedShot, 1.0f); } return(shotVector); }