Beispiel #1
0
    //public void ReturnDecal(int Index)
    //{
    //    DecalPoolFreeIndex--;
    //    DecalMesh ReturningDecal = MeshPool[Index];
    //    MeshPool[Index] = MeshPool[DecalPoolFreeIndex];
    //    MeshPool[Index].PoolIndex = Index;
    //    MeshPool[DecalPoolFreeIndex] = ReturningDecal;
    //    ReturningDecal.gameObject.SetActive(false);
    //}

    public static DecalHandler GetInstance()
    {
        if (Instance == null)
        {
            Instance = new GameObject("DecalHandler").AddComponent <DecalHandler>();
        }
        return(Instance);
    }
 protected void ApplyStats(ParticleSystem.MainModule psMain)
 {
     //Stat changes
     psMain.startLifetime   = weapon.bulletLifeTime;
     psMain.startSpeed      = weapon.bulletSpeed;
     psMain.gravityModifier = weapon.bulletGravity;
     currentDecal           = weapon.currentDecal;
 }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        decalHolder       = GameObject.Find("DecalHolder");
        bloodSplashHolder = GameObject.Find("BloodSplashHolder");
        decalHandler      = GameObject.Find("DecalHandler").GetComponent <DecalHandler>();
        //loadTexture(lowResDecal);
        particle = GetComponent <ParticleSystem>();

        bloodSplatDictionaries = decalHandler.bloodSplatDictionaries;
        bloodSplatSprites      = decalHandler.bloodSplatSprites;
    }
Beispiel #4
0
    void GetPosition()
    {
        LayerMask  LayersToIgnore = LayerMask.GetMask("Decal");
        RaycastHit RayHit;
        Ray        Ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Physics.Raycast(Ray, out RayHit, LayersToIgnore))
        {
            Quaternion Rot      = Quaternion.FromToRotation(Vector3.up, RayHit.normal);
            Vector3    Position = RayHit.point + (RayHit.normal * 0.001f);
            DecalHandler.GetInstance().PlaceDecal(Position, Rot);
        }
    }
Beispiel #5
0
 protected void CopyStats()
 {
     if (playerWeapon.currentDecal != currentDecal)
     {
         currentDecal = playerWeapon.currentDecal;
     }
     if (playerWeapon.leaveDecal != leaveDecal)
     {
         leaveDecal = playerWeapon.leaveDecal;
     }
     if (playerWeapon.obstacleMask != obstacleMask)
     {
         obstacleMask = playerWeapon.obstacleMask;
     }
     if (playerWeapon.rayLenght != rayLenght)
     {
         rayLenght = playerWeapon.rayLenght;
     }
     if (playerWeapon.bulletSpeed != bulletSpeed)
     {
         bulletSpeed = playerWeapon.bulletSpeed;
     }
     if (playerWeapon.numberOfHits != lastWeaponNumberOfHits)
     {
         lastWeaponNumberOfHits = playerWeapon.numberOfHits;
     }
     if (playerWeapon.currentDepot != this)
     {
         playerWeapon.currentDepot = this;
     }
     if (playerWeapon.damage != damage)
     {
         damage = playerWeapon.damage;
     }
     if (playerWeapon.damageType != damageType)
     {
         damageType = playerWeapon.damageType;
     }
     if (playerWeapon.canBounce != canBounce)
     {
         canBounce = playerWeapon.canBounce;
     }
     if (playerWeapon.bulletLifeTime != bulletLifeTime)
     {
         bulletLifeTime = playerWeapon.bulletLifeTime;
     }
     if (playerWeapon.bulletGravity != gravityMulti)
     {
         gravityMulti = playerWeapon.bulletGravity;
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        GameObject[] gos = FindObjectsOfType <GameObject>();

        foreach (GameObject go in gos)
        {
            if (go.CompareTag("Enemy"))
            {
                enemyList.Add(go);
            }
        }

        decalHandler = GameObject.Find("DecalHandler").GetComponent <DecalHandler>();

        for (int i = 0; i < particleSystemHolder.transform.childCount; i++)
        {
            particleSystems.Add(particleSystemHolder.transform.GetChild(i).GetComponent <ParticleSystem>());
        }
        selectedText.text = particleSystems[selected].name.ToString();
    }
    // Start is called before the first frame update
    void Start()
    {
        decalHolder       = GameObject.Find("DecalHolder");
        bloodSplashHolder = GameObject.Find("BloodSplashHolder");
        decalHandler      = GameObject.Find("DecalHandler").GetComponent <DecalHandler>();
        //loadTexture(lowResDecal);
        particle = GetComponent <ParticleSystem>();

        bloodSplatDictionaries = decalHandler.bloodSplatDictionaries;
        bloodSplatSprites      = decalHandler.bloodSplatSprites;
        //nonTransparentPixels = decalHandler.nonTransparentBloodPixels;
        //nonTransparentBlood1Pixels = decalHandler.nonTransparentBlood1Pixels;
        //nonTransparentBlood2Pixels = decalHandler.nonTransparentBlood2Pixels;
        //nonTransparentBlood3Pixels = decalHandler.nonTransparentBlood3Pixels;



        if (bodyPartSplatter)
        {
            //particle.textureSheetAnimation.SetSprite(0, gibSprites[Random.Range(0, gibSprites.Length - 1)]);
        }
    }
Beispiel #8
0
 private void OnDestroy()
 {
     Instance = null;
 }
Beispiel #9
0
 private void Awake()
 {
     Instance = this;
 }