예제 #1
0
    public static void SpawnBlood(int amt, Vector3 loc, Vector3 dir)
    {
        InitIfNeeded();
        //Blood_Splatter.spawnSplatter(loc,dir);
        dir.Normalize();
        Vector3 baseDir = dir;

        loc.z = 0;
        for (int i = 0; i < amt; i++)
        {
            dir = baseDir;
            Blood_Handler handler = new Blood_Handler();
            handler.pos        = loc;
            handler.index      = Generic_Mesh_Script.GetIndex("Mesh_Blood");
            handler.meshScript = Generic_Mesh_Script.GetMeshScript("Mesh_Blood");

            dir.x += Random.Range(-.4f, .4f);
            dir.y += Random.Range(-.4f, .4f);

            Vector3 velocity = dir.normalized;

            //handler.speed = 13f * Random.Range(2f,7f);
            handler.speed    = 20f * Random.Range(3f, 6f);
            handler.velocity = velocity;
            handler.eulerY   = Random.Range(0, 360);
            Generic_Mesh_Script.AddGeneric("Mesh_Blood", handler.pos, handler.eulerY, handler.material, 0f, baseSize, false);

            instanceList.Add(handler);
        }
    }
예제 #2
0
 private Shoot_Flash(Vector3 pos)
 {
     index = Generic_Mesh_Script.GetIndex("Mesh_Top");
     Generic_Mesh_Script.AddGeneric("Mesh_Top", pos, 0f, 0, 0f, baseSize, false);
 }