コード例 #1
0
        public override void OnStart(GameObject go)
        {
            TacticsUnitController componentInParent = (TacticsUnitController)go.GetComponentInParent <TacticsUnitController>();

            if (!Object.op_Implicit((Object)componentInParent))
            {
                return;
            }
            SceneBattle instance = SceneBattle.Instance;

            if (!Object.op_Implicit((Object)instance))
            {
                return;
            }
            Vector3        center      = Vector3.get_zero();
            float          distance    = GameSettings.Instance.GameCamera_SkillCameraDistance;
            List <Vector3> vector3List = new List <Vector3>();

            switch (this.CenterType)
            {
            case CameraMove.eCenterType.Self:
            case CameraMove.eCenterType.All:
                vector3List.Add(componentInParent.CenterPosition);
                if (this.CenterType != CameraMove.eCenterType.All)
                {
                    break;
                }
                goto case CameraMove.eCenterType.Targets;

            case CameraMove.eCenterType.Targets:
                using (List <TacticsUnitController> .Enumerator enumerator = componentInParent.GetSkillTargets().GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        TacticsUnitController current = enumerator.Current;
                        vector3List.Add(current.CenterPosition);
                    }
                    break;
                }
            }
            instance.GetCameraTargetView(out center, out distance, vector3List.ToArray());
            switch (this.DistanceType)
            {
            case CameraMove.eDistanceType.Skill:
                distance = GameSettings.Instance.GameCamera_SkillCameraDistance;
                break;

            case CameraMove.eDistanceType.Far:
                distance = GameSettings.Instance.GameCamera_DefaultDistance;
                break;

            case CameraMove.eDistanceType.MoreFar:
                distance = GameSettings.Instance.GameCamera_MoreFarDistance;
                break;
            }
            instance.InterpCameraTarget(center);
            instance.InterpCameraDistance(distance);
        }