void Start() { hitpoints = 10; lastPlayerHit = null; }
// Update is called once per frame void Update() { player = GetComponentInParent<TennisControllerGans> (); }
void OnTriggerEnter(Collider other) { if (other.CompareTag ("Equipment")) { SecondToLastPlayerHit = lastPlayerHit; lastPlayerHit = other.GetComponent<TennisControllerGans>(); } else if (other.CompareTag ("NothCourt")) { hitpoints--; if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && lastGroundHit) { //SecondToLastPlayerHit.stats.AddPoint(); } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && !lastGroundHit) { //SecondToLastPlayerHit.stats.AddPoint(); } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && !lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && !lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && !lastGroundHit) { } } else if (other.CompareTag ("SouthCourt")) { hitpoints--; if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && !lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit!=null && !lastGroundHit) { } else if(lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && !lastGroundHit) { } else if(!lastPlayerHit.OriginSideNorth && SecondToLastPlayerHit==null && !lastGroundHit) { } } }