private void Shout() { Collider[] girls = Physics.OverlapSphere(m_Fan.CachedTransform.position, m_Fan.Params.ShoutRadius, 1 << 9); int girlsNum = girls.Length; for (int i = 0; i < girlsNum; ++i) { GirlAI girlAI = girls[i].GetComponent <GirlAI>(); if (girlAI != m_Fan) { girlAI.Achtung(GameManager.Instance.Player.CachedTransform.position); } } }
public void ShootAutograph() { if (m_AutographPrefab) { ParticleSystem p = Instantiate(m_AutographPrefab, CachedTransform.position + Vector3.up, CachedTransform.rotation); p.collision.SetPlane(0, GameManager.Instance.Floor); m_AudioSource.PlayOneShot(AutographSound); } Collider[] girls = Physics.OverlapSphere(CachedTransform.position, m_AutographRadius, 1 << 9); int girlsNum = girls.Length; for (int i = 0; i < girlsNum; ++i) { GirlAI girlAI = girls[i].GetComponent <GirlAI>(); girlAI.GetAutographed(); } m_AutographCooldown = m_AutographDelay; }
public void SpawnGirl(int spawnNum) { Transform worldBox = GameManager.Instance.WorldBox.transform; Vector3 worldBoxScale = worldBox.localScale; Vector3 worldBoxPosition = worldBox.position; Vector3 offset = Vector3.zero; NavMeshHit hitInfo; for (int i = 0; i < spawnNum; ++i) { offset.x = worldBoxScale.x * (0.5f * (Random.value * 2f - 1f)); offset.z = worldBoxScale.z * (0.5f * (Random.value * 2f - 1f)); Vector3 spawnPosition = worldBoxPosition + offset; if (NavMesh.SamplePosition(spawnPosition, out hitInfo, 2f, NavMesh.AllAreas)) { GirlAI girl = Instantiate(GirlPrefab, hitInfo.position, Random.rotation).GetComponent <GirlAI>(); girl.Initialize(); m_Girls.Add(girl); } } }
public void ClearSpotted() { Transform worldBox = GameManager.Instance.WorldBox.transform; Vector3 worldBoxScale = worldBox.localScale; Vector3 worldBoxPosition = worldBox.position; Vector3 offset = Vector3.zero; NavMeshHit hitInfo; int spottedCount = m_SpottedFans.Count; for (int i = 0; i < spottedCount; ++i) { GirlAI girl = m_SpottedFans[i]; offset.x = worldBoxScale.x * (0.5f * (Random.value * 2f - 1f)); offset.z = worldBoxScale.z * (0.5f * (Random.value * 2f - 1f)); Vector3 spawnPosition = worldBoxPosition + offset; if (NavMesh.SamplePosition(spawnPosition, out hitInfo, 100f, NavMesh.AllAreas)) { girl.SetRoamingState(); girl.SetTargetDestination(hitInfo.position); } } m_SpottedFans.Clear(); }
public FanSpottedState(GirlAI fan) : base(EFanStateID.Spotted, fan) { }
private void OnEnable() { m_Controller = target as GirlAI; }
public void RemoveSpotted(GirlAI girl) { m_SpottedFans.Remove(girl); }
public void SetSpotted(GirlAI girl) { m_SpottedFans.Add(girl); }
public void CreateFanMarker(GirlAI fan) { UIFanMarker marker = Instantiate(m_FanMarkerPrefab, CachedTransform); marker.Initialize(fan.CachedTransform); }
public FanIdleState(GirlAI partner) : base(EFanStateID.Idle, partner) { }
public FanShoutState(GirlAI fan) : base(EFanStateID.Shout, fan) { }
public FanAutographedState(GirlAI partner) : base(EFanStateID.Autographed, partner) { }
public FanRoamingState(GirlAI fan) : base(EFanStateID.Roaming, fan) { }
public AFanState(EFanStateID id, GirlAI fan) : base((int)id) { StateId = id; m_Fan = fan; }