Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spawning Controller Prefab with Matched Spline Prefab Using Pool Manager
#4
Also these are Curvy Spline and trigger scripts:
   
Code:
using UnityEngine;
using System.Collections;
using PathologicalGames;
using FluffyUnderware.Curvy.Controllers;

public class TriggerScript : MonoBehaviour {
   public Transform enemy;
   public FluffyUnderware.Curvy.CurvySpline curvySpline;
   private SplineController sc;
   private int count = 0;
   void OnTriggerEnter(Collider other)
   {
       Debug.Log("Triggered.");
       Enemy1Create();
   }

   void Enemy1Create()
   {
       sc = enemy.GetComponent<SplineController>();
       PoolManager.Pools["EnemyPool"].Spawn(enemy);
       sc.Spline = curvySpline;
       //Instantiate(enemy, Vector3.zero, Quaternion.identity);
       sc.Play();

       count++;
       if (count < 3)
           Invoke("Enemy1Create", 0.7f);
   }
}
Reply


Messages In This Thread
RE: Spawning Controller Prefab with Matched Spline Prefab Using Pool Manager - by Kerkenez - 03-25-2016, 09:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: