Ejemplo n.º 1
0
    public void initialize(Vector3 direction, bool isServer)
    {
        damage = 15.0f;

        //If put the get function in Start then it will not execute properly
        line = GetComponent <LineRenderer>();

        destination = direction;
        line.SetPosition(0, origin);
        line.SetPosition(1, destination);

        if (!isServer)
        {
            return;
        }

        RaycastHit hit;

        if (Physics.Raycast(origin, destination - origin, out hit))
        {
            LifeSys target = hit.collider.gameObject.GetComponent <LifeSys>();
            if (target != null)
            {
                Debug.Log(maxRadius);
                target.InflictDamage(damage);
            }
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     _health = 100.0f;
     _shield = 100.0f;
     if (hasAuthority)
     {
         playerLifeSystem = this;
     }
 }