Beispiel #1
0
 public void DeleteSubCharAll3DObject()
 {
     NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
     for (int i = 0; i < kSubCharList.Length; i++)
     {
         NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
         nrSubCharEntity.DeleteSubChar(false);
     }
 }
Beispiel #2
0
 public string GetStartChatText(int siCharUnique)
 {
     NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
     for (int i = 0; i < kSubCharList.Length; i++)
     {
         NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
         if (nrSubCharEntity.SubChar != null && (int)nrSubCharEntity.SubChar.GetCharUnique() == siCharUnique)
         {
             return(nrSubCharEntity.StartChatText);
         }
     }
     return(string.Empty);
 }
Beispiel #3
0
 public bool SetSubCharKind_EnptyIndex(int siCharKind)
 {
     NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
     for (int i = 0; i < kSubCharList.Length; i++)
     {
         NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
         if (nrSubCharEntity.SubCharKind == 0)
         {
             nrSubCharEntity.SubCharKind = siCharKind;
             return(true);
         }
     }
     return(false);
 }
Beispiel #4
0
 public NrCharBase GetSubCharByCharKind(int siCharKind)
 {
     if (0 >= siCharKind)
     {
         return(null);
     }
     NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
     for (int i = 0; i < kSubCharList.Length; i++)
     {
         NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
         if (siCharKind == nrSubCharEntity.SubCharKind)
         {
             return(nrSubCharEntity.SubChar);
         }
     }
     return(null);
 }
Beispiel #5
0
    public void FollowParent()
    {
        if (Time.time < this.m_fFollowParentCheckTime)
        {
            return;
        }
        if (this.m_kParentChar == null)
        {
            return;
        }
        if (this.m_kParentChar.m_k3DChar == null)
        {
            return;
        }
        if (null == this.m_kParentChar.m_k3DChar.GetRootGameObject())
        {
            return;
        }
        this.m_fFollowParentCheckTime = Time.time + 0.5f;
        int     num     = -1;
        Vector3 zero    = Vector3.zero;
        Vector3 vector  = Vector3.zero;
        float   num2    = 0f;
        float   num3    = 0f;
        float   num4    = 0f;
        float   num5    = 0f;
        Vector3 vector2 = Vector3.zero;
        Vector3 a       = Vector3.zero;

        NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
        for (int i = 0; i < kSubCharList.Length; i++)
        {
            NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
            if (0 < nrSubCharEntity.SubCharKind && nrSubCharEntity.SubChar != null)
            {
                if (nrSubCharEntity.SubChar.m_k3DChar != null)
                {
                    if (!(null == nrSubCharEntity.SubChar.m_k3DChar.GetRootGameObject()))
                    {
                        vector2 = nrSubCharEntity.SubChar.m_k3DChar.GetRootGameObject().transform.position;
                        num++;
                        float num6 = NrSubCharHelper.s_fSubCharDistance;
                        if (num == 0)
                        {
                            zero.x = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.x;
                            zero.y = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.y;
                            zero.z = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.z;
                            vector = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.TransformDirection(Vector3.forward);
                            float num7 = Mathf.Atan2(vector.x, vector.z) * 180f / 3.14159274f;
                            num7    = 180f - ((num7 <= 0f) ? (num7 + 360f) : num7);
                            vector *= -num6;
                            num2    = zero.x;
                            num3    = zero.z;
                            float f = 0.0174532924f * num7;
                            num4 = Mathf.Cos(f);
                            num5 = Mathf.Sin(f);
                        }
                        else if (num % 2 != 0)
                        {
                            zero.x += 5f;
                        }
                        else
                        {
                            zero.x  = num2;
                            zero.z += 5f;
                        }
                        float num8 = zero.x - num2;
                        float num9 = zero.z - num3;
                        a.x = num4 * num8 + -num5 * num9 + num2;
                        a.y = 0f;
                        a.z = num5 * num8 + num4 * num9 + num3;
                        a  += vector;
                        if (a.x != vector2.x || a.z != vector2.z)
                        {
                            nrSubCharEntity.SubChar.SetSpeed(this.m_kParentChar.m_k3DChar.GetSpeed() * 1f);
                            nrSubCharEntity.SubChar.MoveTo(a.x, a.y, a.z, false);
                        }
                    }
                }
            }
        }
    }
Beispiel #6
0
    public void MakeSubChar()
    {
        if (this.m_kParentChar == null)
        {
            return;
        }
        if (this.m_kParentChar.m_k3DChar == null)
        {
            return;
        }
        if (null == this.m_kParentChar.m_k3DChar.GetRootGameObject())
        {
            return;
        }
        int     num    = -1;
        Vector3 vector = default(Vector3);

        vector.x = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.x;
        vector.y = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.y;
        vector.z = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.position.z;
        Vector3 a    = this.m_kParentChar.m_k3DChar.GetRootGameObject().transform.TransformDirection(Vector3.forward);
        float   num2 = NrSubCharHelper.s_fSubCharDistance;
        Vector3 a2   = a * -num2;
        float   num3 = Mathf.Atan2(a.x, a.z) * 180f / 3.14159274f;

        num3 = 180f - ((num3 <= 0f) ? (num3 + 360f) : num3);
        float   x    = vector.x;
        float   z    = vector.z;
        float   f    = 0.0174532924f * num3;
        float   num4 = Mathf.Cos(f);
        float   num5 = Mathf.Sin(f);
        Vector3 a3   = Vector3.zero;

        NrSubCharHelper.NrSubCharEntity[] kSubCharList = this.m_kSubCharList;
        for (int i = 0; i < kSubCharList.Length; i++)
        {
            NrSubCharHelper.NrSubCharEntity nrSubCharEntity = kSubCharList[i];
            if (0 < nrSubCharEntity.SubCharKind)
            {
                num++;
                if (0 < num)
                {
                    if (num % 2 != 0)
                    {
                        vector.x += 2.5f;
                    }
                    else
                    {
                        vector.x  = x;
                        vector.z += 2.5f;
                    }
                }
                if (nrSubCharEntity.SubChar == null)
                {
                    float num6 = vector.x - x;
                    float num7 = vector.z - z;
                    a3.x = num4 * num6 + -num5 * num7 + x;
                    a3.y = 0f;
                    a3.z = num5 * num6 + num4 * num7 + z;
                    a3  += a2 / 2f;
                    if (!nrSubCharEntity.MakeSubChar(a3.x, a3.z, a.x, a.z))
                    {
                        return;
                    }
                }
            }
        }
        this.m_bNeedMakeSubChar = false;
    }
Beispiel #7
0
 public void Set(NrSubCharHelper.NrSubCharEntity kSubCharEntity)
 {
     this.m_siCharKind = kSubCharEntity.SubCharKind;
     this.m_kChar      = kSubCharEntity.m_kChar;
 }