void Awake() { Transform = transform; GameObject = gameObject; Controller = GetComponent <CharacterController>(); AnimSet = GetComponent <AnimSet>(); Sound = Transform.GetOrAdd <ComponentSound>(); BlackBoard.Owner = this; BlackBoard.GameObject = GameObject; CollisionCenter = Controller.center; }
public void OnAction(Entity entity) { if (camera == null) { return; } if ((entity.Mask & MASK) == MASK) { ComponentGeometry geometryComponent = entity.GetComponent <ComponentGeometry>(); ComponentTransform transform = entity.transform; ComponentMaterial materialComponent = entity.GetComponent <ComponentMaterial>(); ComponentSound sound = entity.GetComponent <ComponentSound>(); if (sound != null) { AL.Source(sound.souce[0], ALSource3f.Position, ref transform.position); //sound.playsoundonce(1); } Draw(transform.GetTransformMatrix(), geometryComponent.Geometry(), materialComponent); } }