예제 #1
0
        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());
        }
예제 #2
0
        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();
        }
예제 #3
0
 public BeziersMovementSystem(BeziersControlPointsBuildInput BeziersControlPointsBuildInput, Action <BeziersMovementSystem> OnMovementStop = null)
 {
     this.BeziersControlPointsBuildInput = BeziersControlPointsBuildInput;
     this.OnMovementEndEvent            += OnMovementStop;
     BeziersMovementJobManager.Get().OnBeziersMovementSystemCreated(this);
 }
예제 #4
0
 public void SetupBeforeObjectCreation(float RecoveredHealth, BeziersControlPointsBuildInput BeziersControlPointsBuildInput)
 {
     this.RuntimeHealthGlobeInteractiveObjectDefinition = this.HealthGlobeInteractiveObjectDefinition;
     this.RuntimeHealthGlobeInteractiveObjectDefinition.SetRecoveredHealthValue(RecoveredHealth);
     this.BeziersControlPointsBuildInput = BeziersControlPointsBuildInput;
 }