コード例 #1
0
ファイル: SPPoint.cs プロジェクト: shrubba/planetexplorers
    public virtual void Init(IntVector4 idx,
                             Transform parent   = null,
                             int spid           = 0,
                             int pathid         = 0,
                             bool isActive      = true,
                             bool revisePos     = true,
                             bool isBoss        = false,
                             bool isErode       = true,
                             bool isDelete      = true,
                             SimplexNoise noise = null,
                             AssetReq.ReqFinishDelegate onSpawned = null,
                             CommonInterface common = null)
    {
        mIndex          = idx;
        mType           = PointType.PT_NULL;
        mSpID           = spid;
        mPathID         = pathid;
        mActive         = isActive;
        mIsBoss         = isBoss;
        mErode          = isErode;
        mDelete         = isDelete;
        mNoise          = noise;
        mNodes          = new List <IntVector4>();
        mRevisePosition = revisePos;
        mWaitForSpawned = false;
        mReqFinish      = onSpawned;
        //mCommon = common;

        AttachEventFromMesh();

        AttachCollider();

        RegisterPoint(this);
    }
コード例 #2
0
    public override void Init(IntVector4 idx, Transform parent = null,
                              int spid    = 0, int pathid       = 0, bool isActive    = true, bool revisePos = true,
                              bool isBoss = false, bool isErode = true, bool isDelete = true, SimplexNoise noise = null,
                              AssetReq.ReqFinishDelegate onSpawned = null, CommonInterface common = null)
    {
        base.Init(idx, parent, spid, pathid, isActive, revisePos, isBoss, isErode, isDelete, noise, onSpawned, common);

        if (pathid > 0)
        {
            AiAsset.AiDataBlock aiData = AiAsset.AiDataBlock.GetAIDataBase(pathid);
            if (aiData != null)
            {
                //mDamage = aiData.damageSimulate;
                mMaxHp = aiData.maxHpSimulate;
                mHp    = mMaxHp;
            }
        }

        if (spid > 0)
        {
            AISpawnPath path = AISpawnPath.GetSpawnPath(spid);
            {
                if (path != null)
                {
                    //mDamage = path.damage;
                    mMaxHp = path.maxHp;
                    mHp    = mMaxHp;
                }
            }
        }
    }
コード例 #3
0
ファイル: SPPoint.cs プロジェクト: shrubba/planetexplorers
    public static T InstantiateSPPoint <T>(Vector3 position,
                                           Quaternion rotation,
                                           IntVector4 idx,
                                           Transform parent   = null,
                                           int spid           = 0,
                                           int pathid         = 0,
                                           bool isActive      = true,
                                           bool revisePos     = true,
                                           bool isBoss        = false,
                                           bool erode         = true,
                                           bool delete        = true,
                                           SimplexNoise noise = null,
                                           AssetReq.ReqFinishDelegate onSpawned = null,
                                           CommonInterface common = null) where T : SPPoint
    {
        GameObject obj = new GameObject("[" + position.x + " , " + position.z + "]");

        obj.transform.parent   = parent;
        obj.transform.position = position;
        obj.transform.rotation = rotation;

        T point = obj.AddComponent <T>();

        point.Init(idx, parent, spid, pathid, isActive, revisePos, isBoss, erode, delete, noise, onSpawned, common);
        return(point);
    }