コード例 #1
0
 protected override void Awake()
 {
     base.Awake();
     if (m_animator == null)
     {
         m_animator = this.GetComponent <Animator>(true);
     }
     if (m_animatorControl == null)
     {
         m_animatorControl = this.GetComponent <AnimatorControl>(true);
     }
     m_animator.cullingMode = AnimatorCullingMode.BasedOnRenderers;
     m_MainView             = this.GetComponent <LevelEntityView>(true);
 }
コード例 #2
0
 protected override void Awake()
 {
     base.Awake();
     if (m_animator == null)
     {
         m_animator = this.GetComponent <Animator>(true);
     }
     if (m_animatorControl == null)
     {
         m_animatorControl = this.GetComponent <AnimatorControl>(true);
     }
     if (m_eventHandler == null)
     {
         m_eventHandler = this.GetComponentInChildren <BaseEventHandler>(true);
     }
     m_animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
     m_MainView             = this.GetComponent <LevelEntityView>(true);
 }
コード例 #3
0
ファイル: EntityPositioning.cs プロジェクト: acosin/MMXLegacy
        public Boolean AddView(IMoveable go, ESize size, out Vector3 localPosition, Int32 p_comeFrom, EntityPositioning p_oldPositioning)
        {
            localPosition = Vector3.zero;
            if (go == null)
            {
                return(false);
            }
            if (m_GameObjects == null)
            {
                m_GameObjects = new Entity[m_Template.Length];
            }
            if (p_comeFrom != -1)
            {
                CalculateRotation();
                Boolean flag = AddViewWithPreviousSlot(go, size, out localPosition, p_comeFrom, p_oldPositioning);
                if (flag)
                {
                    return(true);
                }
            }
            else if (go is LevelEntityView)
            {
                LevelEntityView levelEntityView = (LevelEntityView)go;
                EDirection      direction       = levelEntityView.MyController.Direction;
                SetDirection(direction);
            }
            Int32 num = -1;

            for (Int32 i = 0; i < m_GameObjects.Length; i++)
            {
                if (size != ESize.MEDIUM || i != 1)
                {
                    if (size != ESize.BIG || i == 1)
                    {
                        if (num == -1 && m_GameObjects[i].View == null)
                        {
                            num = i;
                        }
                        if (m_GameObjects[i].View == go)
                        {
                            num = i;
                            break;
                        }
                    }
                }
            }
            if (num > -1)
            {
                if (m_count == 0)
                {
                    num = 1;
                }
                Single num2 = (Single)m_direction * 90f;
                if (m_diagonal)
                {
                    num2 -= 45f;
                }
                localPosition = SetViewIntoSlot(go, num, num);
                return(true);
            }
            localPosition = Vector3.zero;
            return(false);
        }