Jelajahi Sumber

fix check issues

David Catuhe 6 tahun lalu
induk
melakukan
b92b2d4149

+ 2 - 102
src/Actions/abstractActionManager.ts

@@ -1,4 +1,4 @@
-import { IDisposable } from 'scene';
+import { IDisposable } from '../scene';
 import { IActionEvent } from './actionEvent';
 import { IAction } from './action';
 import { Constants } from "../Engines/constants";
@@ -9,106 +9,6 @@ import { Constants } from "../Engines/constants";
  * @see http://doc.babylonjs.com/how_to/how_to_use_actions
  */
 export abstract class AbstractActionManager implements IDisposable {
-    /**
-       * Nothing
-       * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-       */
-    public static readonly NothingTrigger = Constants.ACTION_NothingTrigger;
-
-    /**
-     * On pick
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPickTrigger = Constants.ACTION_OnPickTrigger;
-
-    /**
-     * On left pick
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnLeftPickTrigger = Constants.ACTION_OnLeftPickTrigger;
-
-    /**
-     * On right pick
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnRightPickTrigger = Constants.ACTION_OnRightPickTrigger;
-
-    /**
-     * On center pick
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnCenterPickTrigger = Constants.ACTION_OnCenterPickTrigger;
-
-    /**
-     * On pick down
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPickDownTrigger = Constants.ACTION_OnPickDownTrigger;
-
-    /**
-     * On double pick
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnDoublePickTrigger = Constants.ACTION_OnDoublePickTrigger;
-
-    /**
-     * On pick up
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPickUpTrigger = Constants.ACTION_OnPickUpTrigger;
-    /**
-     * On pick out.
-     * This trigger will only be raised if you also declared a OnPickDown
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPickOutTrigger = Constants.ACTION_OnPickOutTrigger;
-
-    /**
-     * On long press
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnLongPressTrigger = Constants.ACTION_OnLongPressTrigger;
-
-    /**
-     * On pointer over
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPointerOverTrigger = Constants.ACTION_OnPointerOverTrigger;
-
-    /**
-     * On pointer out
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnPointerOutTrigger = Constants.ACTION_OnPointerOutTrigger;
-
-    /**
-     * On every frame
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnEveryFrameTrigger = Constants.ACTION_OnEveryFrameTrigger;
-    /**
-     * On intersection enter
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnIntersectionEnterTrigger = Constants.ACTION_OnIntersectionEnterTrigger;
-
-    /**
-     * On intersection exit
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnIntersectionExitTrigger = Constants.ACTION_OnIntersectionExitTrigger;
-
-    /**
-     * On key down
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnKeyDownTrigger = Constants.ACTION_OnKeyDownTrigger;
-
-    /**
-     * On key up
-     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
-     */
-    public static readonly OnKeyUpTrigger = 15;
 
     /** Gets the list of active triggers */
     public static Triggers: { [key: string]: number } = {};
@@ -191,7 +91,7 @@ export abstract class AbstractActionManager implements IDisposable {
         for (var t in AbstractActionManager.Triggers) {
             if (AbstractActionManager.Triggers.hasOwnProperty(t)) {
                 let t_int = parseInt(t);
-                if (t_int >= AbstractActionManager.OnPickTrigger && t_int <= AbstractActionManager.OnPickUpTrigger) {
+                if (t_int >= Constants.ACTION_OnPickTrigger && t_int <= Constants.ACTION_OnPickUpTrigger) {
                     return true;
                 }
             }

+ 5 - 2
src/Actions/action.ts

@@ -11,6 +11,9 @@ declare type Light = import("../Lights/light").Light;
 declare type Camera = import("../Cameras/camera").Camera;
 declare type Node = import("../node").Node;
 
+/**
+ * Interface used to define Action
+ */
 export interface IAction {
     /**
    * Trigger for the action
@@ -18,7 +21,7 @@ export interface IAction {
     trigger: number;
 
     /** the trigger, with or without parameters, for the action */
-    triggerOptions: any
+    triggerOptions: any;
 
     /**
      * Gets the trigger parameters
@@ -30,7 +33,7 @@ export interface IAction {
      * Internal only - executes current action event
      * @hidden
      */
-    _executeCurrent(evt?: ActionEvent): void
+    _executeCurrent(evt?: ActionEvent): void;
 
     /**
      * Serialize placeholder for child classes

+ 3 - 0
src/Actions/actionEvent.ts

@@ -4,6 +4,9 @@ import { Sprite } from "../Sprites/sprite";
 import { Scene } from "../scene";
 import { Vector2 } from "../Maths/math";
 
+/**
+ * Interface used to define ActionEvent
+ */
 export interface IActionEvent {
     /** The mesh or sprite that triggered the action */
     source: any;

+ 102 - 1
src/Actions/actionManager.ts

@@ -13,6 +13,7 @@ import { Logger } from "../Misc/logger";
 import { DeepCopier } from "../Misc/deepCopier";
 import { _TypeStore } from "../Misc/typeStore";
 import { AbstractActionManager } from './abstractActionManager';
+import { Constants } from "../Engines/constants";
 
 /**
  * Action Manager manages all events to be triggered on a given mesh or the global scene.
@@ -20,8 +21,108 @@ import { AbstractActionManager } from './abstractActionManager';
  * @see http://doc.babylonjs.com/how_to/how_to_use_actions
  */
 export class ActionManager extends AbstractActionManager {
-    // Members
+    /**
+     * Nothing
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly NothingTrigger = Constants.ACTION_NothingTrigger;
+
+    /**
+     * On pick
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPickTrigger = Constants.ACTION_OnPickTrigger;
+
+    /**
+     * On left pick
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnLeftPickTrigger = Constants.ACTION_OnLeftPickTrigger;
+
+    /**
+     * On right pick
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnRightPickTrigger = Constants.ACTION_OnRightPickTrigger;
+
+    /**
+     * On center pick
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnCenterPickTrigger = Constants.ACTION_OnCenterPickTrigger;
+
+    /**
+     * On pick down
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPickDownTrigger = Constants.ACTION_OnPickDownTrigger;
+
+    /**
+     * On double pick
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnDoublePickTrigger = Constants.ACTION_OnDoublePickTrigger;
+
+    /**
+     * On pick up
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPickUpTrigger = Constants.ACTION_OnPickUpTrigger;
+    /**
+     * On pick out.
+     * This trigger will only be raised if you also declared a OnPickDown
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPickOutTrigger = Constants.ACTION_OnPickOutTrigger;
+
+    /**
+     * On long press
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnLongPressTrigger = Constants.ACTION_OnLongPressTrigger;
+
+    /**
+     * On pointer over
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPointerOverTrigger = Constants.ACTION_OnPointerOverTrigger;
 
+    /**
+     * On pointer out
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnPointerOutTrigger = Constants.ACTION_OnPointerOutTrigger;
+
+    /**
+     * On every frame
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnEveryFrameTrigger = Constants.ACTION_OnEveryFrameTrigger;
+    /**
+     * On intersection enter
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnIntersectionEnterTrigger = Constants.ACTION_OnIntersectionEnterTrigger;
+
+    /**
+     * On intersection exit
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnIntersectionExitTrigger = Constants.ACTION_OnIntersectionExitTrigger;
+
+    /**
+     * On key down
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnKeyDownTrigger = Constants.ACTION_OnKeyDownTrigger;
+
+    /**
+     * On key up
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
+     */
+    public static readonly OnKeyUpTrigger = 15;
+
+    // Members
     private _scene: Scene;
 
     /**

+ 1 - 1
src/Meshes/abstractMesh.ts

@@ -22,7 +22,7 @@ import { Skeleton } from "../Bones/skeleton";
 import { IEdgesRenderer } from "../Rendering/edgesRenderer";
 import { SolidParticle } from "../Particles/solidParticle";
 import { Constants } from "../Engines/constants";
-import { AbstractActionManager } from 'Actions/abstractActionManager';
+import { AbstractActionManager } from '../Actions/abstractActionManager';
 
 /** @hidden */
 class _FacetDataStorage {