예제 #1
0
파일: AniResource.cs 프로젝트: pb0/ID0_Test
    public static GameObject CreateAniResOrOther(string prefabPath, Subject2 owner, UserTriggerDelegate handleFunc)
    {
        GameObject gameObject = null;
        if (!string.IsNullOrEmpty(prefabPath))
        {
            gameObject = RecycleManager.Instance.Instantiate(prefabPath);

            if (gameObject != null)
            {
                AniResource aniRes = gameObject.GetComponent<AniResource>();
                if (aniRes != null)
                {
                    aniRes.owner = owner as Automaton;
                    aniRes.RegisterUserTriggerDelegate(handleFunc);
                }
            }

            if (gameObject == null)
            {
                Debug.LogWarning("prefabPath null: [" + prefabPath + "]");

                CubeTile.E_Pivot pivot = CubeTile.E_Pivot.BC;
                if (owner is Projectile)
                {
                    pivot = CubeTile.E_Pivot.MC;
                }
                gameObject = CubeTile.Create(pivot).gameObject;
                gameObject.transform.localScale = new Vector3(owner.Rect.width, owner.Rect.height, 0);
            }
        }
        return gameObject;
    }
예제 #2
0
 public static ObjectAnchor Create(Subject2 owner, LayerRect rect, int cullingLayer)
 {
     ObjectAnchor ret = new GameObject(owner.GetType().Name).AddComponent<ObjectAnchor>();
     ret.gameObject.layer = cullingLayer;
     ret.SetForcingly("owner", owner);
     ret.SetForcingly("centerRect", rect.ObjectRectInLayer);
     ret.transform.parent = rect.point.layer.transform;
     ret.transform.localPosition = new Vector3(ret.centerRect.x, ret.centerRect.y, 0);
     return ret;
 }
        public void BuildsUpPrivateFields()
        {
            var builder = new StyletIoCBuilder();

            builder.Bind <C1>().ToSelf();
            var ioc = builder.BuildContainer();

            var subject = new Subject2();

            ioc.BuildUp(subject);

            Assert.IsInstanceOf <C1>(subject.GetC1());
        }
예제 #4
0
파일: Layer.cs 프로젝트: pb0/ID0_Test
 public void AddSubject(Subject2 subject, float initX, float initY)
 {
     subject.SetPosInLayer(this, new Vector2(initX, initY));
     subject.CullingLayer = cameraBox.CullingLayer;
     addTemp.Add(subject);
 }
예제 #5
0
파일: Layer.cs 프로젝트: pb0/ID0_Test
 public void RemoveSubject(Subject2 subject)
 {
     removeTemp.Add(subject);
 }
예제 #6
0
파일: MenuInGame.cs 프로젝트: pb0/ID0_Test
 // fsm interface
 public void SetFocusTarget(Subject2 target)
 {
     float cameraX = 0f;
     if (target is HeroCharacter)
     {
         float screenPositionRatio = convertHPRatioToScreenPos((target as HeroCharacter).HPRatio);
         cameraX = screenPositionRatio * Constants.Instance.Field.CameraWidth - Constants.Instance.Field.CameraWidth / 2;
     }
     SetHeroChasing(target, cameraX);
 }
예제 #7
0
파일: MenuInGame.cs 프로젝트: pb0/ID0_Test
 // fsm interface
 public void PanCameraTo(Subject2 target)
 {
     field.FocusOnForced(target, 0);
 }
예제 #8
0
파일: MenuInGame.cs 프로젝트: pb0/ID0_Test
 // fsm interface
 public void MoveCameraTo(Subject2 target)
 {
     const float targetPos = 0.5f;
     field.SetFocus(target, targetPos, 30);
 }
예제 #9
0
파일: MenuInGame.cs 프로젝트: pb0/ID0_Test
    // fsm interface
    public bool IsInCenter(Subject2 target)
    {
        const float threshold = 0.05f;

        if (target != null)
        {
            float posX = target.Rect.point.InBoxPoint.x;
            return -threshold <= posX && posX <= threshold;
        }
        return false;
    }
예제 #10
0
파일: TileLayer.cs 프로젝트: pb0/ID0_Test
 private void AddSubject(Subject2 subject)
 {
 }
예제 #11
0
파일: MenuInGame.cs 프로젝트: pb0/ID0_Test
    void SetHeroChasing(Subject2 target, float initPos)
    {
        cameraChaseTarget = target;

        if (target != null)
        {
            field.FocusOnForced(target, initPos);
        }
    }
예제 #12
0
파일: CameraBox.cs 프로젝트: pb0/ID0_Test
    public void FocusOnForced(Subject2 target, float inBoxOffsetX)
    {
        float targetOffsetX = target.Rect.point.InLayerPoint.x - inBoxOffsetX;

        foreach (var entity in layers)
        {
            float ratio = 1;
            if (layerInfos.ContainsKey(entity.Key))
            {
                ratio = layerInfos[entity.Key].speed;
            }

            float offsetX = -targetOffsetX * ratio;
            float offsetY = 0;

            if (-1 <= entity.Key && entity.Key <= 1)    // ddong
            {
                offsetY = -worldClipping.height / 2 + fieldSetting.PlayerOffsetY;
            }
            if (layerInfos.ContainsKey(entity.Key))
            {
                offsetY = -worldClipping.height / 2 + layerInfos[entity.Key].offsetY;
            }

            Vector2 offset = new Vector2(offsetX, offsetY);
            offset += CameraEffect.Instance.FlickOffset;
            entity.Value.coord.SetOffset(offset);
        }
    }
예제 #13
0
		public Component1 componentOf;					//0..1

		public KnowledgeRequestNotification() {
			classCode="ACT";
			moodCode="DEF";
			IdList=new List<Id>();
			effectiveTime=DateTime.Now;
			subject1=new Subject();
			subject2=new Subject1();
			subject3=new Subject2();
			subject4List=new List<Subject3>();
			componentOf=new Component1();
		}
예제 #14
0
파일: CameraBox.cs 프로젝트: pb0/ID0_Test
    public void FocusOn(Subject2 target, float inBoxOffsetX, float maxSpeed)
    {
        float currInBoxX = target.Rect.point.InBoxPoint.x;

        /*
        // type 1
        {
            inBoxOffsetX = (currInBoxX + inBoxOffsetX) / 2f;
        }
        */


        // type 1-1
        {
            float maxDistancePerFrame = maxSpeed * Time.deltaTime;      // not using InGameDelta
            inBoxOffsetX = Mathf.Clamp((currInBoxX + inBoxOffsetX) / 2f, currInBoxX - maxDistancePerFrame, currInBoxX + maxDistancePerFrame);
        }


        // type 2
        /*
        {
            const float maxSpeedPerSec = 50f;
            float maxSpeedPerFrame = maxSpeedPerSec * TimeTool.InGameDeltaTime;
            float distance = inBoxOffsetX - currInBoxX;

            distance = Mathf.Clamp(distance, -maxSpeedPerFrame, maxSpeedPerFrame);
            inBoxOffsetX = currInBoxX + distance;
        }
         * */

        // type 3
        /*
        {
            float maxSpeedPerSec = 50f;
            float distance = inBoxOffsetX - currInBoxX;

            if (distance < 4)
            {
                maxSpeedPerSec *= Mathf.Sqrt(Mathf.Abs(distance)) / 2; // 2= sqrt(4)
            }
            float maxSpeedPerFrame = maxSpeedPerSec * TimeTool.InGameDeltaTime;

            distance = Mathf.Clamp(distance, -maxSpeedPerFrame, maxSpeedPerFrame);
            inBoxOffsetX = currInBoxX + distance;
        }
         * */

        FocusOnForced(target, inBoxOffsetX);
    }
예제 #15
0
 public StockObserver(string name, Subject2 s)
 {
     this.name = name;
     this.subject = s;
 }
예제 #16
0
파일: Field.cs 프로젝트: pb0/ID0_Test
 public void FocusOnForced(Subject2 target, float inBoxOffsetX)
 {
     box.FocusOnForced(target, inBoxOffsetX);
 }
예제 #17
0
파일: Field.cs 프로젝트: pb0/ID0_Test
 public void SetFocus(Subject2 target, float screenPositionRatio, float maxSpeed)
 {
     if (target != null)
     {
         float cameraX = screenPositionRatio * Constants.Instance.Field.CameraWidth - Constants.Instance.Field.CameraWidth / 2;
         box.FocusOn(target, cameraX, maxSpeed);
     }
 }
        public void BuildsUpPrivateFields()
        {
            var builder = new StyletIoCBuilder();
            builder.Bind<C1>().ToSelf();
            var ioc = builder.BuildContainer();

            var subject = new Subject2();
            ioc.BuildUp(subject);

            Assert.IsInstanceOf<C1>(subject.GetC1());
        }