예제 #1
0
    private void ChangeToolCursor(Tool tool)
    {
        if (tool != null)
        {
            if (gfxAnimator != null)
            {
                gfxAnimator.runtimeAnimatorController = tool.AnimatorController;
                gfxSkeletonAnimator.skeletonDataAsset = tool.AnimationDataAsset;
                gfxSkeletonAnimator.Initialize(true);
            }

            if (gfxAnimator == null || gfxSkeletonAnimator == null || tool.AnimationDataAsset == null || tool.AnimationDataAsset == null)
            {
                gfx.sprite = tool.Icon;
            }
            else
            {
                gfx.sprite = null;
            }

            Cursor.visible = false;
        }
        else
        {
            gfx.sprite = null;
            gfxAnimator.runtimeAnimatorController = null;
            gfxSkeletonAnimator.skeletonDataAsset = null;
            gfxSkeletonAnimator.Initialize(true);

            Cursor.visible = true;
        }
    }
예제 #2
0
        public override void Awake()
        {
            base.Awake();
            SkeletonAnimator skeletonAnimator = MainAnimator.gameObject.GetComponent <SkeletonAnimator>();

            skeletonAnimator.initialSkinName = "qiu";
            skeletonAnimator.Initialize(true);
            MainRigidbody.useGravity     = true;
            MainRigidbody.freezeRotation = true;
            foreach (RoleController roleController in SceneManager.Instance.CurrScene.RoleControllerList)
            {
                if (roleController.RoleData.TeamId != TeamId)
                {
                    mubiaolist.Add(roleController);
                }
            }
            mubiaolist.Sort((RoleController a, RoleController b) =>
            {
                if ((gameObject.transform.position - a.transform.position).magnitude > (gameObject.transform.position - b.transform.position).magnitude)
                {
                    return(1);
                }
                else if ((gameObject.transform.position - a.transform.position).magnitude < (gameObject.transform.position - b.transform.position).magnitude)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            });
            // MainDamageController.gameObject.SetActive(false);
        }
 public void ChangeToRed()
 {
     sk.skeletonDataAsset = red;
     sk.Initialize(true);
 }