Beispiel #1
0
 public void OnRemoveChar(BasicPhysics aic)
 {
     if (m_overlapObjects.Contains(aic))
     {
         aic.transform.Find("SpritePieces").transform.localPosition = aic.transform.Find("SpritePieces").transform.localPosition - Offset;
         m_overlapObjects.Remove(aic);
     }
 }
Beispiel #2
0
 public void OnAddChar(BasicPhysics aic)
 {
     if (!m_overlapObjects.Contains(aic))
     {
         aic.transform.Find("SpritePieces").transform.localPosition = aic.transform.Find("SpritePieces").transform.localPosition + Offset;
         m_overlapObjects.Add(aic);
     }
 }
Beispiel #3
0
 public void OnRemoveChar(BasicPhysics aic)
 {
     if (OverlapObjects.Contains(aic))
     {
         aic.RemoveParticleSystem(gameObject);
         OverlapObjects.Remove(aic);
     }
 }
Beispiel #4
0
    //private HealthDisplay m_display;

    internal void Awake()
    {
        m_charBase      = GetComponent <CharacterBase>();
        m_physics       = GetComponent <BasicPhysics>();
        m_health        = Mathf.Min(Health, MaxHealth);
        m_currDeathTime = 0.0f;
        InitResistences();
        GetComponent <PersistentItem>()?.InitializeSaveLoadFuncs(storeData, loadData);
    }
Beispiel #5
0
 private void particleProcess(BasicPhysics physics)
 {
     if (physics.DrawParticles && ParticlePrefab != null && physics.m_trueVelocity.magnitude > 0.1f && physics.IsGrounded)
     {
         if (physics.ShouldDrawParticle())
         {
             physics.EmitParticle(gameObject, EmitParticleAmount);
             //Instantiate(ParticlePrefab, physics.transform.position, Quaternion.identity);
         }
     }
 }
Beispiel #6
0
 public void OnAddChar(BasicPhysics aic)
 {
     if (!OverlapObjects.Contains(aic))
     {
         if (ParticlePrefab != null)
         {
             aic.AddParticleSystem(gameObject, ParticlePrefab);
             //aic.EmitParticle(gameObject, EmitParticleAmount);
             //Instantiate(ParticlePrefab, aic.transform.position, Quaternion.identity);
         }
         OverlapObjects.Add(aic);
     }
 }
Beispiel #7
0
        private void Awake()
        {
            _physics = GetComponent <BasicPhysics>();

            _animation = new AnimationManager(GetComponent <Animator>());

            _weapon = transform.GetComponentInChildren <IGun>();

            ((IWearable)_weapon)?.SetOwner(this);

            Life.Reset();
            Life.OnDie += OnDie;

            lookPoint = new GameObject("lookPoint").transform;
            lookPoint.SetParent(transform);

            OnAwake();
        }
Beispiel #8
0
 internal void Awake()
 {
     m_physics             = GetComponent <BasicPhysics>();
     m_lastInput           = new Vector2();
     m_aiCustomControl     = GetComponent <ControlAI>();
     m_playerCustomControl = GetComponent <ControlPlayer>();
     m_orient = GetComponent <Orientation>();
     m_eqp    = GetComponent <InventoryContainer>();
     m_trueAverageVelocity = new Vector3();
     lastPos = transform.position;
     if (CanJump)
     {
         SetJumpHeight(JumpHeight);
     }
     updateCustomControl();
     if (GetComponent <PersistentItem>() != null)
     {
         GetComponent <PersistentItem>().InitializeSaveLoadFuncs(storeData, loadData);
     }
 }
Beispiel #9
0
    internal void Awake()
    {
        m_physics             = GetComponent <BasicPhysics>();
        m_lastInput           = new InputPacket();
        m_orient              = GetComponent <Orientation>();
        m_trueAverageVelocity = new Vector3();
        m_aibase              = new List <AIInputParentClass>(GetComponents <AIInputParentClass>());
        m_InputHandlers       = new List <InputHandler>(GetComponents <InputHandler>());


        lastPos = transform.position;
        if (CanJump)
        {
            SetJumpHeight(JumpHeight);
        }
        if (GetComponent <PersistentItem>() != null)
        {
            GetComponent <PersistentItem>().InitializeSaveLoadFuncs(storeData, loadData);
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     m_physics    = GetComponent <BasicPhysics> ();
     m_attackable = GetComponent <Attackable> ();
 }
Beispiel #11
0
 public bool IsHaveObject(BasicPhysics aic)
 {
     return(OverlapObjects.Contains(aic));
 }