Beispiel #1
0
        public void ExecEventsFromCol(Pathea.PECapsuleHitResult colInfo)                // exetern call
        {
            if (_bExecExtEnable)
            {
                SkEntity tar = (SkEntity)colInfo.hitTrans;
                if (tar != null && !_hitInGuide.Contains(tar) && (_target == null || _target == tar))
                {
                    _colInfo = colInfo;
                    foreach (SkTriggerEvent skEvent in _eventsActFromCol)
                    {
                        if (skEvent.Exec(this))
                        {
                            _hitInGuide.Add(tar);
                            break;                             // filter left skevent if needed
                        }
                    }
                    //Debug.Log("[Skill] Hit:" + _hit);
                }
            }
#if DBG_COL_ATK
            else
            {
                Debug.Log("Event not executed because in " + _dbgStep);
            }
#endif
        }
Beispiel #2
0
        public bool Contain(Pathea.PECapsuleHitResult colInfo)
        {
            string strCol0 = (colTypes[0] == ColType.ColName) ? colInfo.selfTrans.name : LayerMask.LayerToName(colInfo.selfTrans.gameObject.layer);
            string strCol1 = (colTypes[1] == ColType.ColName) ? colInfo.hitTrans.name : LayerMask.LayerToName(colInfo.hitTrans.gameObject.layer);

            if (colStrings[0][0].Length == 0 || colStrings[0].Contains(strCol0))
            {
                if (colStrings[1][0].Length == 0 || colStrings[1].Contains(strCol1))
                {
                    return(true);
                }
#if DBG_COL_ATK
                string log = "FAILED Target Col:" + strCol1 + "|";
                foreach (string str in colStrings[1])
                {
                    log += str + ",";
                }
                Debug.Log(log);
#endif
                return(false);
            }
#if DBG_COL_ATK
            string log = "FAILED Target Col:" + strCol0 + "|";
            foreach (string str in colStrings[0])
            {
                log += str + ",";
            }
            Debug.Log(log);
#endif
            return(false);
        }
Beispiel #3
0
        public void CollisionCheck(Pathea.PECapsuleHitResult colInfo)
        {
            int n = _instsActFromExt.Count;

            for (int i = 0; i < n; i++)
            {
                _instsActFromExt[i].ExecEventsFromCol(colInfo);
            }
        }
Beispiel #4
0
        public static RagdollHitInfo CapsuleHitToRagdollHit(Pathea.PECapsuleHitResult hitResult)
        {
            RagdollHitInfo hitInfo = new RagdollHitInfo();

            hitInfo.hitTransform = hitResult.hitTrans;
            hitInfo.hitPoint     = hitResult.hitPos;
            hitInfo.hitForce     = hitResult.hitDir * 1000.0f;
            return(hitInfo);
        }
Beispiel #5
0
        // Collision test
        public void CollisionCheck(Collider selfCol, Collider otherCol)
        {
            Pathea.PECapsuleHitResult colInfo = new Pathea.PECapsuleHitResult();
            colInfo.selfTrans = selfCol.transform;
            colInfo.hitTrans  = otherCol.transform;
            // Other var evaluate
            int n = _instsActFromExt.Count;

            for (int i = 0; i < n; i++)
            {
                _instsActFromExt[i].ExecEventsFromCol(colInfo);
            }
        }