// 自动采矿机
// Token: 0x06002362 RID: 9058 RVA: 0x000BFD8C File Offset: 0x000BDF8C
protected override void OnSpawn()
{
base.OnSpawn();
this.hitEffectPrefab = Assets.GetPrefab("fx_dig_splash");
KBatchedAnimController component = base.GetComponent();
string name = component.name + ".gun";
this.arm_go = new GameObject(name);
this.arm_go.SetActive(false);
this.arm_go.transform.parent = component.transform;
this.looping_sounds = this.arm_go.AddComponent();
string sound = GlobalAssets.GetSound(this.rotateSoundName, false);
this.rotateSound = RuntimeManager.PathToEventReference(sound);
this.arm_go.AddComponent().PrefabTag = new Tag(name);
this.arm_anim_ctrl = this.arm_go.AddComponent();
this.arm_anim_ctrl.AnimFiles = new KAnimFile[]
{
component.AnimFiles[0]
};
this.arm_anim_ctrl.initialAnim = "gun";
this.arm_anim_ctrl.isMovable = true;
this.arm_anim_ctrl.sceneLayer = Grid.SceneLayer.TransferArm;
component.SetSymbolVisiblity("gun_target", false);
bool flag;
Vector3 position = component.GetSymbolTransform(new HashedString("gun_target"), out flag).GetColumn(3);
position.z = Grid.GetLayerZ(Grid.SceneLayer.TransferArm);
this.arm_go.transform.SetPosition(position);
this.arm_go.SetActive(true);
this.link = new KAnimLink(component, this.arm_anim_ctrl);
base.Subscribe(-592767678, AutoMiner.OnOperationalChangedDelegate);
this.RotateArm(this.rotatable.GetRotatedOffset(Quaternion.Euler(0f, 0f, -45f) * Vector3.up), true, 0f);
this.StopDig();
base.smi.StartSM();