예제 #1
0
        void findComponents()
        {
            if (boxCollider == null)
            {
                boxCollider = GetComponent <BoxCollider>();
            }

            //if (_kineticRigidbody == null)
            //    _kineticRigidbody = GetComponent<Rigidbody>();

            if (sprrs == null)
            {
                sprrs = new List <SpriteRenderer>();
            }

            if (sprrs.Count == 0)
            {
                sprrs.AddRange(transform.root.GetComponentsInChildren <SpriteRenderer>());
            }

            if (_character == null)
            {
                _character = transform.root.GetComponentInChildren <IsometricMovement>();
            }

            if (iso == null)
            {
                iso = transform.root.GetComponentInChildren <IsometricSortingOrder>();
            }

            if (boxCollider == null || sprrs.Count == 0) // _rigidbody == null
            {
                enabled = false;
                return;
            }

            if (IsoMap.IsNull || !IsoMap.instance.bUseIsometricSorting)
            {
                Debug.Log("TallCharacterHelper is available in Auto ISO Mode!");
                boxCollider.enabled = enabled = false;
                return;
            }

            boxCollider.enabled   = enabled = true;
            boxCollider.isTrigger = true;

            if (_kineticRigidbody != null)
            {
                _kineticRigidbody.isKinematic = true;
            }
        }
예제 #2
0
        void OnEnable()
        {
            if ((_target = (IsometricSortingOrder)target) == null)
            {
                return;
            }

            if (bPrefab = PrefabHelper.IsPrefab(_target.gameObject))
            {
                return;
            }

            _iParticleSortingAdd = serializedObject.FindProperty("iParticleSortingAdd");
            _iLastSortingOrder   = serializedObject.FindProperty("iLastSortingOrder");
            _iExternSortingAdd   = serializedObject.FindProperty("_iExternAdd");
            // _bStaticISO = serializedObject.FindProperty("bStaticISO");
        }
예제 #3
0
        void OnEnable()
        {
            if (bPrefab = PrefabUtility.GetPrefabType(target).Equals(PrefabType.Prefab))
            {
                return;
            }

            if ((_target = (IsometricSortingOrder)target) == null)
            {
                return;
            }

            _iParticleSortingAdd = serializedObject.FindProperty("iParticleSortingAdd");
            _iLastSortingOrder   = serializedObject.FindProperty("iLastSortingOrder");
            _iExternSortingAdd   = serializedObject.FindProperty("_iExternAdd");
            // _bStaticISO = serializedObject.FindProperty("bStaticISO");
        }
예제 #4
0
        public void Init(SpriteRenderer _sprr = null)
        {
            if (spriteMask == null)
            {
                spriteMask = GetComponent <SpriteMask>();
            }
            if (sprr == null)
            {
                sprr = _sprr != null ? _sprr : GetComponentInParent <SpriteRenderer>();
            }
            if (order == null)
            {
                order = GetComponent <IsometricSortingOrder>();
            }
            order.AddUpdateCallBack(this);

            spriteMask.alphaCutoff = 1;

            UpdateSprite();
        }