Example #1
0
    public void OnInject()
    {
        pysicItem.SetPosition(transform.position);
        Container.Inject(pysicItem);

        pysicItem.itemWidth  = size.x;
        pysicItem.itemHeight = size.y;
    }
Example #2
0
 public void SetPos(Vector2Int pos)
 {
     spawnPos           = pos;
     viewReciver        = GetComponent <UnitViewReciver>();
     pysicItem          = viewReciver.pysicItem;
     transform.position = new Vector3(pos.x * TileDataProvider.TileSize, pos.y * TileDataProvider.TileSize + 3, transform.position.z);
     pysicItem.SetPosition(transform.position);
 }
Example #3
0
 public void ReSpawnFromDead()
 {
     gameObject.SetActive(false);
     CooldownManager.AddCooldown(3, null, () => {
         pysicItem.AddVelocity(-pysicItem.velocity);
         transform.position = new Vector3(spawnPos.x * TileDataProvider.TileSize, spawnPos.y * TileDataProvider.TileSize + 3, transform.position.z);
         pysicItem.SetPosition(transform.position);
         SetHP(100);
         gameObject.SetActive(true);
     });
 }
Example #4
0
    public virtual void OnInject()
    {
        Container.Inject(pysicItem);

        pysicItem.itemWidth  = size.x;
        pysicItem.itemHeight = size.y;

        pysicItem.SetMomentVector(momentVector);
        pysicItem.SetGravity(gravity);
        pysicItem.SetPosition(transform.position);
        pysicItem.ReboundFactor = ReboundFactor;
    }
Example #5
0
    public void Init(Vector2Int pos)
    {
        spawnPos    = pos;
        viewReciver = GetComponent <UnitViewReciver>();
        pysicItem   = viewReciver.pysicItem;

        transform.position = new Vector3(pos.x * TileDataProvider.TileSize, pos.y * TileDataProvider.TileSize + 3, transform.position.z);
        pysicItem.SetPosition(transform.position);
        pysicItem.OnCollision += OnCollision;

        maxHp  = 100;
        currHp = 100;

        //  TargetManager.Player = this;
    }