public static CoreInteractiveObject SpawnHealthGlobeWithDefaultModel(CoreInteractiveObject SourceInteractiveObject, HealthGlobeSpawnInitializationData HealthGlobeSpawnInitializationData) { var GlobalHealthGlobeConfiguration = GlobalHealthGlobeConfigurationGameObject.Get().GlobalHealthGlobeConfiguration; var HealthGlobeInteractiveObjectInitializerTemplate = GameObject.Instantiate(GlobalHealthGlobeConfiguration.HealthGlobeTemplatePrefab); var BeziersControlPointsBuildInput = new BeziersControlPointsBuildInput( SourceInteractiveObject.InteractiveGameObject.GetAverageModelWorldBounds().center, HealthGlobeSpawnInitializationData.WorldPosition, Vector3.up, BeziersControlPointsShape.CURVED, Random.Range(2.5f, 3f)); HealthGlobeInteractiveObjectInitializerTemplate.SetupBeforeObjectCreation(HealthGlobeSpawnInitializationData.HealthRecovered, BeziersControlPointsBuildInput); return(HealthGlobeInteractiveObjectInitializerTemplate.Init()); }
public HealthGlobeInteractiveObject(HealthGlobeInteractiveObjectDefinitionStruct healthGlobeInteractiveObjectDefinitionStruct, IInteractiveGameObject interactiveGameObject, BeziersControlPointsBuildInput BeziersControlPointsBuildInput, bool IsUpdatedInMainManager = true) { this.HealthGlobeInteractiveObjectDefinitionStruct = healthGlobeInteractiveObjectDefinitionStruct; this.interactiveObjectTag = new InteractiveObjectTag() { IsGivingHealth = true }; interactiveGameObject.CreateLogicCollider(healthGlobeInteractiveObjectDefinitionStruct.InteractiveObjectSphereLogicColliderDefinitionStruct); base.BaseInit(interactiveGameObject, IsUpdatedInMainManager); this.SpawnBeziersMovementSystem = new BeziersMovementSystem(BeziersControlPointsBuildInput, this.OnHealthGlobeSpawnBeziersMovementEnded); this.SpawnBeziersMovementSystem.StartBeziersMovement(); }
public BeziersMovementSystem(BeziersControlPointsBuildInput BeziersControlPointsBuildInput, Action <BeziersMovementSystem> OnMovementStop = null) { this.BeziersControlPointsBuildInput = BeziersControlPointsBuildInput; this.OnMovementEndEvent += OnMovementStop; BeziersMovementJobManager.Get().OnBeziersMovementSystemCreated(this); }
public void SetupBeforeObjectCreation(float RecoveredHealth, BeziersControlPointsBuildInput BeziersControlPointsBuildInput) { this.RuntimeHealthGlobeInteractiveObjectDefinition = this.HealthGlobeInteractiveObjectDefinition; this.RuntimeHealthGlobeInteractiveObjectDefinition.SetRecoveredHealthValue(RecoveredHealth); this.BeziersControlPointsBuildInput = BeziersControlPointsBuildInput; }