Exemplo n.º 1
0
        public void Add(SkCond colCond)
        {
            SkFuncInOutPara funcOut = new SkFuncInOutPara(_inst, colCond._para);
            SkCondColDesc   cols    = funcOut.GetColDesc();

            if (cols.colTypes[0] == SkCondColDesc.ColType.ColName)
            {
                foreach (string str in cols.colStrings[0])
                {
                    Collider col = _inst._caster.GetCollider(str);
                    if (col != null && !_colPositions.ContainsKey(col))
                    {
                        _colPositions[col] = new Positions(col.Pos());
                    }
                }
            }
            else
            {
                //TODO : Getcollider by layer
                Debug.LogError("Unimplemented code for getting collider from collayer cond");

                /*
                 * foreach(string str in cols.colStrings[0])
                 * {
                 *      Collider col = _inst._caster.GetCollider(str);
                 *      if(col != null && !_colPositions.ContainsKey(col))
                 *      {
                 *              _colPositions[col] = new Positions(col.Pos());
                 *      }
                 * }
                 */
            }
        }
Exemplo n.º 2
0
        internal static SkFuncInOutPara TstColLayer(SkInst inst, System.Object strColDesc)
        {
            SkFuncInOutPara funcOut = new SkFuncInOutPara(inst, strColDesc);

            if (inst._colInfo == null)
            {
                return(funcOut);
            }

            SkCondColDesc cols = funcOut.GetColDesc();

            cols.colTypes[0] = cols.colTypes[1] = SkCondColDesc.ColType.ColLayer;
            if (cols.Contain(inst._colInfo))
            {
                SkEntity curTar = (SkEntity)inst._colInfo.hitTrans;
                if (curTar != null)
                {
                    funcOut._para = new List <SkEntity>()
                    {
                        curTar
                    };
                }
                funcOut._ret = true;
            }
            return(funcOut);
        }