public TriangleColliderComponent(Entity entity, float width, float height, CollisionLayers layer, Oritation oritation)
 {
     this.Width        = width;
     this.Height       = height;
     this.Entity       = entity;
     this.Layer        = layer;
     this.BoundaryType = CollisionBoundaryType.Triangle;
     this.myOritation  = oritation;
     this.Position     = entity.Position;
     this.size         = entity.Height;
     this.NormalVector = TriangleColliderComponent.Normals[(int)this.myOritation];
     this.NormalVector.Normalize();
 }
Example #2
0
    public static void init(string appKey, string channelID, Oritation appOritation, bool debugMode)
    {
        if (OnAdShowSuccess == null || OnAdShowFail == null)
        {
            throw new System.Exception("请在初始化之前定义广告播放的回调函数");
        }
        else
        {
            Debug.Log("测试回调方法");
            // OnAdShowSuccess();
            // OnAdShowFail("");
        }

#if UNITY_IPHONE
        if (debugMode)
        {
            Debug.Log("测试模式");
            _initSDK("i100010000", "i100010001", (int)appOritation);
        }
        else
        {
            _initSDK(appKey, channelID, (int)appOritation);
        }
#elif UNITY_ANDROID
        Debug.Log("初始化");

        if (debugMode)
        {
            Debug.Log("测试模式");
            _plugin.Call("init", "a100010000", "a100010000", (int)appOritation);
        }
        else
        {
            _plugin.Call("init", appKey, channelID, (int)appOritation);
        }
#endif

        PreloadVideo();
    }