/* public override Parameters.DynamicParameters GetParameters() { return _instanceParameters; }*/ public static CharacterLogicController CreateCharacter(string __nameIsId, GameLevel __level, bool _needMC) { CharacterParameters parameters = StaticObjects.CharacterParameters[__nameIsId]; GameCharacter myCharacter = new GameCharacter(parameters._levelObjectName, Matrix.Identity, __level); GameSimpleObject myHead = new GameSimpleObject(parameters._headObjectName, __level, Engine.Logic.PivotObjectDependType.Head, false, false); CharacterLogicController result = new CharacterLogicController(__level, myCharacter, myHead, !_needMC); result._baseParameters = parameters; return result; }
public static EffectLogicController CreateEffect(string __id, GameLevel __level, Vector3 __position, Vector3 __normal) { EffectParameters ep = StaticObjects.EffectParameters[__id]; EffectLogicController res = new EffectLogicController(__level, ep); res._objects = new GameObject[ep._effectItems.Length]; for (int i = 0; i < ep._effectItems.Length; i++) { EffectParameters.EffectItem item = ep._effectItems[i]; switch (item._type) { case EffectItemType.Object: { GameSimpleObject effectObject = new GameSimpleObject(ep._effectItems[i]._parameters["objectName"].ToString(), __level); effectObject._object.SetGlobalPose(Matrix.CreateBillboard(__position + __normal * 0.02f, __position + __normal * 20, Vector3.Up, -__normal), true); res._objects[i] = effectObject; } break; //TODO: other cases case EffectItemType.Billboard: { }break; case EffectItemType.ConstrainedBillboard: { } break; case EffectItemType.Particles: { float size = Convert.ToSingle((ep._effectItems[i]._parameters["size"] as string).Replace('.', ',')); int count = Convert.ToInt32((ep._effectItems[i]._parameters["count"] as string).Replace('.',',')); float dispersion = Convert.ToSingle((ep._effectItems[i]._parameters["dispersion"] as string).Replace('.',',')); float gravity = Convert.ToSingle((ep._effectItems[i]._parameters["gravity"] as string).Replace('.',',')); float angledisp = Convert.ToSingle((ep._effectItems[i]._parameters["angledisp"] as string).Replace('.', ',')); float speed = Convert.ToSingle((ep._effectItems[i]._parameters["speed"] as string).Replace('.', ',')); float speeddisp = Convert.ToSingle((ep._effectItems[i]._parameters["speeddisp"] as string).Replace('.', ',')); GameParticleObject effectObject = new GameParticleObject( ep._effectItems[i]._parameters["objectName"] as string, __level, new Vector3(size), count, __normal, dispersion, gravity, angledisp, speed, speeddisp, item._lifeTime); effectObject._object.SetGlobalPose(Matrix.CreateTranslation(__position), true); res._objects[i] = effectObject; } break; } } return res; }
public CharacterLogicController(GameLevel __level, GameCharacter __hisObject, GameSimpleObject __hisHead, bool __isMe = false) : base(__level) { _hisHead = __hisHead; _hisObject = __hisObject; _isAlive = false; _isMe = __isMe; _hisObject._levelObject._needMouseCast = _hisObject._levelObject._needMouseCast && !_isMe; _hisHead._object._needMouseCast = _hisHead._object._needMouseCast && !_isMe; _hisObject._levelObject._gameObject = this; }