public void Init(SkeletonAnimation skeleton, bool flashGhost) { // Store the new skeleton in a member variable this.skeleton = skeleton; // If the skeleton ghost should flash on the skeleton if (flashGhost) { // Create a new SkeletonGhostFlasher to make the skeleton flash with color skeletonGhost = skeleton.gameObject.AddComponent <SkeletonGhostFlasher>(); } else { // Create a new SkeletonGhost to create the color ghost skeletonGhost = skeleton.gameObject.AddComponent <Brawler.SkeletonGhost>(); skeletonGhost.color = flashColor; skeletonGhost.spawnRate = 0.2f; //0.05f; skeletonGhost.fadeSpeed = 5f; //5.0f; skeletonGhost.maximumGhosts = 3; skeletonGhost.additive = true; } // Disable the skeleton ghosting skeletonGhost.ghostingEnabled = false; }
public void Init(SkeletonAnimation skeleton) { // Store the new skeleton in a member variable this.skeleton = skeleton; // Create a new SkeletonGhostFlasher to make the skeleton flash with color skeletonFlasher = skeleton.gameObject.AddComponent <SkeletonGhostFlasher>(); skeletonFlasher.color = flashColor; skeletonFlasher.additive = true; // Create a new SkeletonGhost which generates the ghosting skeletonGhost = skeleton.gameObject.AddComponent <Brawler.SkeletonGhost>(); skeletonGhost.color = ghostColor; skeletonGhost.spawnRate = 0.2f; //0.05f; skeletonGhost.fadeSpeed = 5f; //5.0f; skeletonGhost.maximumGhosts = 3; skeletonGhost.additive = true; // Disable the skeleton ghosting and flashing skeletonFlasher.ghostingEnabled = skeletonGhost.ghostingEnabled = false; }