override public void RayHit() { base.RayHit(); if (sw == null) { return; } sw.SetSwitchOn(true); }
void InitDB() { uac = GetComponentInChildren <UnityArmatureComponent>(); uac.AddDBEventListener(EventObject.COMPLETE, (string type, EventObject eventObject) => { if (eventObject.animationState.name == "rod_up") { if (curSwitch != null) { curSwitch.SetSwitchOn(false); } // UpdateUpStates(); } }); uac.animation.Play("idle"); // // 设置移动动画 // rodMoveState = uac.animation.FadeIn("rod_move", 0f, 1, 2, "moveGroup"); // rodMoveState.resetToPose = false; // rodMoveState.Stop(); }