void UpdateBaseStatusPoint()
    {
        Vector3[] baseValuePoint = new Vector3[anglePoint.Length];
        baseValuePoint[0] = anglePoint[0];
        for (int i = 1; i < baseValuePoint.Length; i++)
        {
            baseValuePoint[i] = anglePoint[i] * (status.GetPrimaryAttrubute((PrimaryAttributeName)i - 1).baseValue > 110 ? 110 : status.GetPrimaryAttrubute((PrimaryAttributeName)i - 1).baseValue) / 100;
        }
        ;

        for (int i = 0; i < baseValuePoint.Length - 1; i++)
        {
            UILabel label = baseMesh.transform.Find(((PrimaryAttributeName)i).ToString()).GetComponent <UILabel>();
            label.transform.localPosition = baseValuePoint[i + 1] * 0.8f;
            label.text  = status.GetPrimaryAttrubute((PrimaryAttributeName)i).baseValue.ToString();
            label.color = Color.white;
        }

        baseMesh.mesh.Clear();
        baseMesh.mesh.vertices  = baseValuePoint;
        baseMesh.mesh.triangles = new int[] {
            0, 1, 2,
            0, 2, 3,
            0, 3, 4,
            0, 4, 5,
            0, 5, 6,
            0, 6, 1
        };
    }
Example #2
0
    //待命
    protected virtual void Idle()
    {
        if (animationController != null)
        {
            animationController.PlayIdle();
        }
        navAgent.destination = myTransform.position;

        //else
        //{
        if (!IsGarrison && mainTarget == null && !isGuardPlayer)
        {
            //索敵
            float seed = Random.Range(0, CHANCE_TO_SEARCH_WIS_RATIO);
            //機率進入索敵狀態
            if (Time.time - _searchTimer > SearchTime + .1f && seed < status.GetPrimaryAttrubute(PrimaryAttributeName.Wisdom).AdjustedValue)
            {
                _searchTimer = 0;
                state        = NPCMotion.Search;
            }
            else
            {
                state = NPCMotion.Deciding;
            }
        }
        else
        {
            state = NPCMotion.Deciding;
        }
        //}
    }