Exemple #1
0
 public SpriteColorComponent(SpriteRenderer renderer, string shaderColor = "_Color", float maxDamageScale = 1.15f)
 {
     _spriteRender = new CachedUnityComponent <SpriteRenderer>(renderer);
     _shaderColor  = shaderColor;
     DmgMaxScale   = maxDamageScale;
     Setup();
 }
Exemple #2
0
 public SpriteColorComponent(SerializationInfo info, StreamingContext context)
 {
     _shaderColor  = info.GetValue(nameof(_shaderColor), _shaderColor);
     _spriteRender = info.GetValue(nameof(_spriteRender), _spriteRender);
     DmgMaxScale   = info.GetValue(nameof(DmgMaxScale), DmgMaxScale);
     BaseColor     = info.GetValue(nameof(BaseColor), BaseColor);
     Setup();
 }
Exemple #3
0
 public void SetRb(Rigidbody rb)
 {
     _component = new CachedUnityComponent <Rigidbody>(rb);
     if (Rb != null)
     {
         RigidbodySetup.Setup(Rb);
     }
 }
Exemple #4
0
 public PathfindingDebugging(LineRenderer lineR, TextMesh tm, GameObject debugObject = null)
 {
     LineR = new CachedUnityComponent <LineRenderer>(lineR);
     Tm    = new CachedUnityComponent <TextMesh>(tm);
     if (debugObject != null)
     {
         DebugObject = new CachedTransform(debugObject.transform);
     }
 }
Exemple #5
0
 public RigidbodyComponent(SerializationInfo info, StreamingContext context)
 {
     _component     = info.GetValue(nameof(_component), _component);
     RigidbodySetup = new RigidbodySettings();
     if (Rb != null)
     {
         RigidbodySetup.Setup(Rb);
     }
 }
Exemple #6
0
 public SpriteAnimationComponent(SpriteRenderer renderer, SpriteAnimation animation, bool unscaled, BillboardMode billboard)
 {
     _component        = new CachedUnityComponent <SpriteRenderer>(renderer);
     Animation         = animation;
     Unscaled          = unscaled;
     Billboard         = billboard;
     CurrentFrameIndex = 0;
     UpdateFrame(Unscaled ? TimeManager.TimeUnscaled : TimeManager.Time);
 }
Exemple #7
0
 public RigidbodyComponent(Rigidbody rb)
 {
     RigidbodySetup = new RigidbodySettings();
     _component     = new CachedUnityComponent <Rigidbody>(rb);
     if (Rb != null)
     {
         RigidbodySetup.Setup(Rb);
     }
 }
Exemple #8
0
 public SpriteAnimationComponent(SerializationInfo info, StreamingContext context)
 {
     _component        = info.GetValue(nameof(_component), _component);
     Unscaled          = info.GetValue(nameof(Unscaled), Unscaled);
     Billboard         = info.GetValue(nameof(Billboard), Billboard);
     NextUpdateTime    = info.GetValue(nameof(NextUpdateTime), NextUpdateTime);
     CurrentFrameIndex = info.GetValue(nameof(CurrentFrameIndex), CurrentFrameIndex);
     LastAngleHeight   = info.GetValue(nameof(LastAngleHeight), LastAngleHeight);
     ItemPool.LoadAsset <SpriteAnimation>(info.GetValue(nameof(Animation), ""), a => Animation = a);
 }
Exemple #9
0
 public SpriteDissolveParticlesComponent(SerializationInfo info, StreamingContext context)
 {
     CurrentHealth  = info.GetValue(nameof(CurrentHealth), CurrentHealth);
     SpriteRenderer = info.GetValue(nameof(SpriteRenderer), SpriteRenderer);
 }
Exemple #10
0
 public SpriteDissolveParticlesComponent(SpriteRenderer spriteRenderer)
 {
     SpriteRenderer = new CachedUnityComponent <SpriteRenderer>(spriteRenderer);
 }
Exemple #11
0
 public ColliderComponent(SerializationInfo info, StreamingContext context)
 {
     _component = info.GetValue(nameof(_component), _component);
 }
Exemple #12
0
 public PathfindingDebugging(SerializationInfo info, StreamingContext context)
 {
     LineR       = info.GetValue(nameof(LineR), LineR);
     Tm          = info.GetValue(nameof(Tm), Tm);
     DebugObject = info.GetValue(nameof(DebugObject), DebugObject);
 }
Exemple #13
0
 public ColliderComponent(Collider collider)
 {
     _component  = new CachedUnityComponent <Collider>(collider);
     LocalCenter = new Vector3(0, Collider.bounds.size.y * 0.5f, 0);
 }
Exemple #14
0
 public FirstPersonAnimatorComponent(PlayerWeaponAnimator animator)
 {
     _component = new CachedUnityComponent <PlayerWeaponAnimator>(animator);
 }
 public UnitySensorComponent(Sensor sensor)
 {
     _sensor = new CachedUnityComponent <Sensor>(sensor);
 }
 public UnityAnimatorComponent(Animator animator)
 {
     _animator = new CachedUnityComponent <Animator>(animator);
 }
 public ColliderDetailComponent(MeshCollider collider)
 {
     _component = new CachedUnityComponent <MeshCollider>(collider);
 }
 public UnitySensorComponent(SerializationInfo info, StreamingContext context)
 {
     _sensor = info.GetValue(nameof(_sensor), _sensor);
 }
Exemple #19
0
 public void Dispose()
 {
     RigidbodySetup = null;
     _component     = null;
 }
Exemple #20
0
 public FirstPersonAnimatorComponent(SerializationInfo info, StreamingContext context)
 {
     _component = info.GetValue(nameof(_component), _component);
 }
Exemple #21
0
 public PrefabComponent(PrefabEntity entity)
 {
     _component = new CachedUnityComponent <PrefabEntity>(entity);
 }