Пример #1
0
    void AddToCapture(IPhxControlableInstance other)
    {
        PhxPawnController controller = other.GetController();

        if (controller != null)
        {
            CaptureControllers.Add(controller);
            controller.CapturePost = this;
            RefreshCapture();
        }
    }
Пример #2
0
    public void RemoveFromCapture(IPhxControlableInstance other)
    {
        PhxPawnController controller = other.GetController();

        if (controller != null)
        {
            CaptureControllers.Remove(controller);
            controller.CapturePost = null;
            RefreshCapture();
        }
    }
Пример #3
0
    public void FireProjectile(PhxPawnController owner, Vector3 pos, Quaternion rot, PhxBolt bolt)
    {
        PhxProjectile proj = Projectiles.Alloc();

        Physics.IgnoreCollision(proj.Coll, owner.Pawn.GetInstance().GetComponent <CapsuleCollider>());
        if (proj != null)
        {
            proj.Setup(owner, pos, rot, bolt);
        }
        //Debug.Break();
    }
Пример #4
0
    public void Setup(PhxPawnController owner, Vector3 pos, Quaternion rot, PhxBolt bolt)
    {
        Owner = owner;

        Body.transform.position = pos;
        Body.transform.rotation = rot;
        Body.velocity           = Body.transform.forward * bolt.Velocity;

        Light.color = bolt.LightColor;

        Renderer.startWidth = bolt.LaserWidth;
        Renderer.endWidth   = bolt.LaserWidth;
        Renderer.SetPosition(1, new Vector3(0f, 0f, bolt.LaserLength * 2f));
        Renderer.material.SetTexture("_UnlitColorMap", bolt.LaserTexture);
        Renderer.material.SetTexture("_EmissiveColorMap", bolt.LaserTexture);
        Renderer.material.SetColor("_EmissiveColor", bolt.LightColor.Get() * EmissionIntensity);
    }
Пример #5
0
    public void Fire(PhxPawnController owner, Vector3 targetPos)
    {
        if (FireDelay <= 0f && ReloadDelay == 0f && MagazineAmmo >= C.ShotsPerSalvo)
        {
            if (Audio != null)
            {
                float half = C.PitchSpread / 2f;
                Audio.pitch = UnityEngine.Random.Range(1f - half, 1f + half);
                Audio.Play();
            }

            if (C.OrdnanceName.Get() != null)
            {
                PhxBolt bolt = C.OrdnanceName.Get() as PhxBolt;
                if (HpFire != null && bolt != null)
                {
                    Vector3    dirVec = targetPos - HpFire.position;
                    Quaternion dir    = Quaternion.LookRotation(dirVec);
                    Scene.FireProjectile(owner, HpFire.position, dir, bolt);
                    Debug.DrawRay(HpFire.position, dirVec, Color.red);
                }
            }

            ShotCallback?.Invoke();
            FireDelay = C.ShotDelay;

            if (!Game.InfiniteAmmo)
            {
                MagazineAmmo -= C.ShotsPerSalvo;
            }
            if (MagazineAmmo < C.ShotsPerSalvo)
            {
                Reload();
            }
        }
    }
Пример #6
0
 public void Fire(PhxPawnController owner, Vector3 targetPos)
 {
 }