Ejemplo n.º 1
0
        private void LockOn()
        {
            StudioChara character = instance.CurrentChara;

            if (character != null)
            {
                int newHash = character.GetHashCode();
                if (characterHash != newHash)
                {
                    cameraTarget = null;
                }
                characterHash = newHash;

                CharBody body   = character.body;
                string   prefix = character is StudioFemale ? "cf_" : "cm_";
                if (!cameraTarget)
                {
                    cameraTarget = body.objBone.transform.FindLoop(prefix + boneList[0]);
                }
                else
                {
                    for (int i = 0; i < boneList.Length; i++)
                    {
                        if (cameraTarget.name == prefix + boneList[i])
                        {
                            string boneName = boneList.ElementAtOrDefault(i + 1) != null ? prefix + boneList[i + 1] : prefix + boneList[0];
                            cameraTarget = body.objBone.transform.FindLoop(boneName);
                            break;
                        }
                    }
                }

                if (lastBonePos == null)
                {
                    lastBonePos = cameraTarget.transform.position;
                }
                normalCameraMoveSpeed = camera.moveSpeed;
                camera.moveSpeed      = 0.0f;

                CreateInfoMsg("Locked to \"" + cameraTarget.name + "\"");
            }
        }
Ejemplo n.º 2
0
        private void LockOn(int listItem)
        {
            StudioChara character = instance.CurrentChara;

            if (character != null)
            {
                characterHash = character.GetHashCode();

                CharBody body   = character.body;
                string   prefix = character is StudioFemale ? "cf_" : "cm_";

                cameraTarget = body.objBone.transform.FindLoop(prefix + boneList[listItem]);

                if (lastBonePos == null)
                {
                    lastBonePos = cameraTarget.transform.position;
                }
                normalCameraMoveSpeed = camera.moveSpeed;
                camera.moveSpeed      = 0.0f;

                CreateInfoMsg("Locked to \"" + cameraTarget.name + "\"");
            }
        }