Пример #1
0
    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);
            }
        }
    }
Пример #2
0
    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;
    }
Пример #3
0
    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);
            }
        }
    }
Пример #4
0
    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();
    }
Пример #5
0
 public FanSpottedState(GirlAI fan) : base(EFanStateID.Spotted, fan)
 {
 }
Пример #6
0
 private void OnEnable()
 {
     m_Controller = target as GirlAI;
 }
Пример #7
0
 public void RemoveSpotted(GirlAI girl)
 {
     m_SpottedFans.Remove(girl);
 }
Пример #8
0
 public void SetSpotted(GirlAI girl)
 {
     m_SpottedFans.Add(girl);
 }
Пример #9
0
    public void CreateFanMarker(GirlAI fan)
    {
        UIFanMarker marker = Instantiate(m_FanMarkerPrefab, CachedTransform);

        marker.Initialize(fan.CachedTransform);
    }
Пример #10
0
 public FanIdleState(GirlAI partner) : base(EFanStateID.Idle, partner)
 {
 }
Пример #11
0
 public FanShoutState(GirlAI fan) : base(EFanStateID.Shout, fan)
 {
 }
Пример #12
0
 public FanAutographedState(GirlAI partner) : base(EFanStateID.Autographed, partner)
 {
 }
Пример #13
0
 public FanRoamingState(GirlAI fan) : base(EFanStateID.Roaming, fan)
 {
 }
Пример #14
0
 public AFanState(EFanStateID id, GirlAI fan) : base((int)id)
 {
     StateId = id;
     m_Fan   = fan;
 }