Ejemplo n.º 1
0
 public void SetData(ActivityBaseInfo data, Vector3 targetPos, int index, float delayTime)
 {
     if (data == null)
     {
         return;
     }
     m_delayTime            = delayTime;
     m_Index                = index;
     tween.From             = Widget.anchoredPosition3D;
     tween.To               = targetPos;
     m_icon_img.TextureName = data.Icon;
     m_desc_lab.Text        = LocalizeModule.Instance.GetString(data.Descs);
     m_tips_img.Visible     = true;
     if (data.Type == 1)
     {
         m_tips_img.Sprite = "lable_type5_2.png";
     }
     else if (data.Type == 2)
     {
         m_tips_img.Sprite = "lable_type5_1.png";
     }
     else
     {
         m_tips_img.Visible = false;
     }
 }
Ejemplo n.º 2
0
        private void OnChooseFinish(int index)
        {
            if (index > m_activity_data.Count - 1)
            {
                Debug.Log("activity error");
                return;
            }
            ActivityBaseInfo activityBase = m_activity_data[index];

            //ConfActivityBase activityBase = ConfActivityBase.Get(index + 1);
            EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_ACTIVITY);
            if (activityBase != null)
            {
                if (0 == activityBase.TargetType)
                {
                    string[] targetEntryPrefab = activityBase.TargetPrefab.Split(',');
                    string   targetPrefab      = targetEntryPrefab[0];
                    if (activityBase.Stage == 1)
                    {
                        targetPrefab = targetEntryPrefab[1];
                    }

                    FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(targetPrefab);
                    param.Param = activityBase;
                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
                }
            }
        }
Ejemplo n.º 3
0
 public ActivityBase(GameObject ownerGO, ActivityBaseInfo activityInfo)
 {
     this.ownerGO      = ownerGO;
     activityManager   = ownerGO.GetComponent <ActivityManager>();
     animator          = ownerGO.GetComponent <Animator>();
     networkInput      = ownerGO.GetComponent <NetworkInput>();
     this.activityInfo = activityInfo;
 }
Ejemplo n.º 4
0
    private ActivityBase CreateActivity(Type activityType, ActivityBaseInfo activityInfo)
    {
        Type[]       cstrTypes      = new Type[] { typeOfGameObject, activityInfo.GetType() };
        object[]     cstrValues     = new object[] { rootGO, activityInfo };
        ActivityBase resultActivity = (ActivityBase)activityType.GetConstructor(cstrTypes).Invoke(cstrValues);

        return(resultActivity);
    }
Ejemplo n.º 5
0
    public virtual ActivityBaseInfo Clone()
    {
        ActivityBaseInfo resultObject = new ActivityBaseInfo();

        resultObject.activityTypeName  = activityTypeName;
        resultObject.animatorParamName = animatorParamName;
        resultObject.animatorParamType = animatorParamType;
        return(resultObject);
    }
Ejemplo n.º 6
0
        public override void OnShow(object param)
        {
            if (param != null)
            {
                m_activityBaseInfo = param as ActivityBaseInfo;

                MessageHandler.RegisterMessageHandler(MessageDefine.SCActivityDropResponse, OnSyncDropActivityResponse);
                CSActivityRequest requestDropActivityDetail = new CSActivityRequest();
                requestDropActivityDetail.Id = this.m_activityBaseInfo.Id;
#if !NETWORK_SYNC || UNITY_EDITOR
                GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(requestDropActivityDetail);
#else
                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(requestDropActivityDetail);
#endif


                this.m_lbActivityTime.Text = $"{CommonTools.TimeStampToDateTime(this.m_activityBaseInfo.StartTime).ToString("yyyy-MM-dd HH:mm:ss")} ~ {CommonTools.TimeStampToDateTime(this.m_activityBaseInfo.EndTime).ToString("yyyy-MM-dd HH:mm:ss")}";
            }

            SetCloseBtnID("Button_close");
        }
Ejemplo n.º 7
0
 public ActivityTurn(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
 }
Ejemplo n.º 8
0
 public ActivityJump(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
     transform = ownerGO.transform;
     rigidbody = ownerGO.GetComponent <Rigidbody>();
 }
Ejemplo n.º 9
0
 public ActivityBing(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
     attrManager = ownerGO.GetComponent <AttributesManager>();
     partManager = ownerGO.GetComponent <PartManager>();
 }
Ejemplo n.º 10
0
 public ActivityOnSky(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
     transform = ownerGO.transform;
     collider  = ownerGO.GetComponent <Collider>();
     rigidbody = ownerGO.GetComponent <Rigidbody>();
 }
Ejemplo n.º 11
0
 public ActivityStopMove(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
 }
Ejemplo n.º 12
0
 public ActivityReachOut(GameObject ownerGO, ActivityBaseInfo activityInfo) : base(ownerGO, activityInfo)
 {
     attrManager = ownerGO.GetComponent<AttributesManager>();
     reachOutInfo = activityInfo as ActivityReachOutInfo;
     reachOutIKTran = ownerGO.transform.Find(reachOutInfo.IKGameObjectName);
 }