Exemple #1
0
    void Start()
    {
        mUEntity = new UEntity();
        ECSWorld.MainWorld.registerEntityAfterInit(mUEntity);
        InfluenceMapTrigger tInfluenceMapTrigger = new InfluenceMapTrigger();

        tInfluenceMapTrigger.mWhere       = "friend";
        tInfluenceMapTrigger.maxInfluence = maxDistance;
        tInfluenceMapTrigger.mGameObject  = this.gameObject;
        tInfluenceMapTrigger.mIMComputer  = DefaultFunc.friendComputer;

        mUEntity.AddComponent <InfluenceMapTrigger> (tInfluenceMapTrigger);
        tInfluenceMapTrigger.Init();
        //	ECSWorld.MainWorld.registerEntityAfterInit (mUEntity);
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        UEntity mUEntity = new UEntity();

        ECSWorld.MainWorld.registerEntityAfterInit(mUEntity);
        RiskComponent rComponent = new RiskComponent();

        rComponent.riskrate = risk;
        mUEntity.AddComponent <RiskComponent> (rComponent);
        InfluenceMapTrigger tInfluenceMapTrigger = new InfluenceMapTrigger();

        tInfluenceMapTrigger.mWhere       = "Risk";
        tInfluenceMapTrigger.maxInfluence = maxDistance;
        tInfluenceMapTrigger.mGameObject  = this.gameObject;
        tInfluenceMapTrigger.mIMComputer  = DefaultFunc.RiskComputer;

        tInfluenceMapTrigger.Init();
        mUEntity.AddComponent <InfluenceMapTrigger> (tInfluenceMapTrigger);
    }