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); }
// 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); }