예제 #1
0
        public static bool SetLocator(Transform objectTransform, Transform locatorTransform, string locatorName, bool isFollowingFlag)
        {
            bool      result    = false;
            Transform transform = AdventureObject.FindLocator(locatorTransform, locatorName);

            if (null != transform)
            {
                if (isFollowingFlag)
                {
                    objectTransform.parent = transform;
                }
                else
                {
                    objectTransform.position = transform.position;
                    objectTransform.rotation = transform.rotation;
                }
                objectTransform.localPosition = Vector3.zero;
                objectTransform.localRotation = Quaternion.identity;
                objectTransform.localScale    = Vector3.one;
                result = true;
            }
            else
            {
                global::Debug.Log("ロケータ設定失敗");
            }
            return(result);
        }
예제 #2
0
        public bool SetTargetStageLocator(string locatorName, bool isFollowingFlag)
        {
            bool flag = AdventureObject.SetLocator(this.cameraAnimator.transform, ClassSingleton <AdventureSceneData> .Instance.stage.transform, locatorName, isFollowingFlag);

            if (flag)
            {
                if (!isFollowingFlag)
                {
                    this.cameraAnimator.transform.parent = this.adventureSceneRootTransform;
                }
                this.camera3D.transform.LookAt(this.cameraAnimator.transform);
            }
            return(flag);
        }
예제 #3
0
        public override bool RunScriptCommand()
        {
            bool flag = false;
            AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

            if (digimonInfo != null)
            {
                flag = AdventureObject.SetLocator(digimonInfo.model.transform, ClassSingleton <AdventureSceneData> .Instance.stage.transform, this.stageLocatorName, this.isFollowingFlag);
                if (flag)
                {
                    base.ResumeScriptEngine();
                }
            }
            return(flag);
        }
예제 #4
0
 public static Transform FindLocator(Transform t, string locatorName)
 {
     if (null != t)
     {
         if (t.name == locatorName)
         {
             return(t);
         }
         for (int i = 0; i < t.childCount; i++)
         {
             Transform transform = AdventureObject.FindLocator(t.GetChild(i), locatorName);
             if (null != transform)
             {
                 return(transform);
             }
         }
     }
     return(null);
 }
예제 #5
0
        public override bool RunScriptCommand()
        {
            bool flag = true;
            AdventureEffectInfo effectInfo = ClassSingleton <AdventureSceneData> .Instance.GetEffectInfo(this.effectId);

            if (effectInfo != null)
            {
                if ("stage" == this.locatorType)
                {
                    flag = AdventureObject.SetLocator(effectInfo.model.transform, ClassSingleton <AdventureSceneData> .Instance.stage.transform, this.locatorName, this.isFollowingFlag);
                }
                else if ("chara" == this.locatorType)
                {
                    AdventureDigimonInfo digimonInfo = ClassSingleton <AdventureSceneData> .Instance.GetDigimonInfo(this.charaId);

                    if (digimonInfo != null)
                    {
                        flag = AdventureObject.SetLocator(effectInfo.model.transform, digimonInfo.model.transform, this.locatorName, this.isFollowingFlag);
                    }
                }
                else
                {
                    Quaternion localRotation = effectInfo.model.transform.localRotation;
                    Vector3    localPosition = effectInfo.model.transform.localPosition;
                    Vector3    localScale    = effectInfo.model.transform.localScale;
                    effectInfo.model.transform.parent        = ClassSingleton <AdventureSceneData> .Instance.adventureCamera.camera3D.transform;
                    effectInfo.model.transform.localScale    = localScale;
                    effectInfo.model.transform.localPosition = localPosition;
                    effectInfo.model.transform.localRotation = localRotation;
                }
            }
            if (flag)
            {
                base.ResumeScriptEngine();
            }
            return(flag);
        }